registerClient method

Future<RegisterClientResponse> registerClient({
  1. required String clientName,
  2. required String clientType,
  3. List<String>? scopes,
})

Registers a client with AWS SSO. This allows clients to initiate device authorization. The output should be persisted for reuse through many authentication requests.

May throw InvalidRequestException. May throw InvalidScopeException. May throw InvalidClientMetadataException. May throw InternalServerException.

Parameter clientName : The friendly name of the client.

Parameter clientType : The type of client. The service supports only public as a client type. Anything other than public will be rejected by the service.

Parameter scopes : The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.

Implementation

Future<RegisterClientResponse> registerClient({
  required String clientName,
  required String clientType,
  List<String>? scopes,
}) async {
  ArgumentError.checkNotNull(clientName, 'clientName');
  ArgumentError.checkNotNull(clientType, 'clientType');
  final $payload = <String, dynamic>{
    'clientName': clientName,
    'clientType': clientType,
    if (scopes != null) 'scopes': scopes,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/client/register',
    signed: false,
    exceptionFnMap: _exceptionFns,
  );
  return RegisterClientResponse.fromJson(response);
}