loginWithClientCredentials method
Implementation
Future<Credential> loginWithClientCredentials() async {
if (type != FlowType.clientCredentials) {
throw UnsupportedError('Flow is not clientCredentials');
}
var json = await http.post(client.issuer.tokenEndpoint,
body: {
'grant_type': 'client_credentials',
'client_id': client.clientId,
if (client.clientSecret != null) 'client_secret': client.clientSecret,
'scope': scopes.join(' ')
},
client: client.httpClient);
return Credential._(client, TokenResponse.fromJson(json), null);
}