authorize static method

Future<String> authorize(
  1. String scope,
  2. String? pkceS256CodeChallenge
)

Initiate authentication via the OIDC authorization code flow for confidential clients.

An app implementing the Embedded SDK initiates an authentication request with Beyond Identity. Using the confidential client API assumes that a secure backend exists that can safely store the client secret and can exchange the authorization code for an access and ID token.

scope is the OIDC scope used during authentication. Only "openid" is currently supported. pkceS256CodeChallenge is an optional, but recommended PKCE challenge used to prevent authorization code injection that can be obtained by invoking createPkce.

Returns the authorization code that can be used to redeem tokens from the Beyond Identity token endpoint.

Implementation

static Future<String> authorize(String scope, String? pkceS256CodeChallenge) async {
  final String authorizationCode = await _channel.invokeMethod('authorize', {
    'scope': scope,
    'pkceS256CodeChallenge': pkceS256CodeChallenge,
  });
  return authorizationCode;
}