Skip to content

Commit

Permalink
feat: add device parameter to implicit flow
Browse files Browse the repository at this point in the history
  • Loading branch information
rbellens committed Dec 30, 2022
1 parent 70ffbeb commit 5a6bf04
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions lib/src/openid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,27 @@ class Flow {
codeVerifier: codeVerifier,
);

Flow.implicit(Client client, {String? state})
Flow.implicit(Client client, {String? state, String? device})
: this._(
FlowType.implicit,
['token id_token', 'id_token token', 'id_token', 'token']
.firstWhere((v) =>
client.issuer.metadata.responseTypesSupported.contains(v)),
[
'token id_token',
'id_token token',
'id_token',
'token',
].firstWhere((v) =>
client.issuer.metadata.responseTypesSupported.contains(v)),
client,
state: state);
state: state,
scopes: [
'openid',
'profile',
'email',
if (device != null) 'offline_access'
],
additionalParameters: {
if (device != null) 'device': device
});

Flow.jwtBearer(Client client) : this._(FlowType.jwtBearer, null, client);

Expand Down

0 comments on commit 5a6bf04

Please sign in to comment.