authorizeUrl method

String authorizeUrl(
  1. dynamic params
)

Builds the full authorize endpoint url in the Authorization Server (AS) with given parameters. parameters params to send to /authorize @param String params.responseType type of the response to get from /authorize. @param String params.redirectUri where the AS will redirect back after success or failure. @param String params.state random string to prevent CSRF attacks. @returns String authorize url with specified params to redirect to for AuthZ/AuthN. ref link: https://auth0.com/docs/api/authentication#authorize-client

Implementation

//
String authorizeUrl(dynamic params) {
  assert(params['redirectUri'] != null &&
      params['responseType'] != null &&
      params['state'] != null);
  var query = Map.from(params)
    ..addAll({
      'redirect_uri': params['redirectUri'],
      'response_type': params['responseType'],
      'state': params['state'],
    });
  return _dioWrapper.url(
    '/authorize',
    query: Map.from({'client_id': this.clientId})..addAll(query),
    includeTelemetry: true,
  );
}