startDeviceAuthorization method
Initiates device authorization by requesting a pair of verification codes from the authorization service.
May throw InternalServerException.
May throw InvalidClientException.
May throw InvalidRequestException.
May throw SlowDownException.
May throw UnauthorizedClientException.
Parameter clientId :
The unique identifier string for the client that is registered with IAM
Identity Center. This value should come from the persisted result of the
RegisterClient API operation.
Parameter clientSecret :
A secret string that is generated for the client. This value should come
from the persisted result of the RegisterClient API operation.
Parameter startUrl :
The URL for the Amazon Web Services access portal. For more information,
see Using
the Amazon Web Services access portal in the IAM Identity Center
User Guide.
Implementation
Future<StartDeviceAuthorizationResponse> startDeviceAuthorization({
required String clientId,
required String clientSecret,
required String startUrl,
}) async {
final $payload = <String, dynamic>{
'clientId': clientId,
'clientSecret': clientSecret,
'startUrl': startUrl,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/device_authorization',
signed: false,
exceptionFnMap: _exceptionFns,
);
return StartDeviceAuthorizationResponse.fromJson(response);
}