initiateProviderRegistration method

Future<InitiateProviderRegistrationOutput> initiateProviderRegistration({
  1. required Provider provider,
})

Initiates the OAuth registration flow with a third-party provider. Returns a redirect URL and CSRF state token for completing the authorization.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter provider : The provider to initiate registration with. Currently, only GITHUB is supported.

Implementation

Future<InitiateProviderRegistrationOutput> initiateProviderRegistration({
  required Provider provider,
}) async {
  final $payload = <String, dynamic>{
    'provider': provider.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/oauth2/provider/register',
    exceptionFnMap: _exceptionFns,
  );
  return InitiateProviderRegistrationOutput.fromJson(response);
}