requestDeviceCode method

FutureOr<DeviceCodeResponse> requestDeviceCode(
  1. Client client,
  2. Iterable<String> scopes,
  3. RequestContext req,
  4. ResponseContext res,
)

Performs a device code grant.

Implementation

FutureOr<DeviceCodeResponse> requestDeviceCode(Client client,
    Iterable<String> scopes, RequestContext req, ResponseContext res) async {
  var body = await req.parseBody().then((_) => req.bodyAsMap);
  throw AuthorizationException(
    ErrorResponse(
      ErrorResponse.unsupportedResponseType,
      'Device code grants are not supported.',
      body['state']?.toString() ?? '',
    ),
    statusCode: 400,
  );
}