openid_client
openid_client copied to clipboard
Issue , integrating flutter web app with ForgeRock
I used web version of the example, no matter what I do I end up with the error :
{
"error": "unauthorized_client",
"error_description": "The authenticated client is not authorized to use this authorization grant type."
}
"Do I need to create metadata ? I registered client ID and issuer URL in forgeRock, do I need to do anything else ? Does web version work authorization code flow"
I am using this code // import the browser version import 'package:openid_client/openid_client_browser.dart';
authenticate(Uri uri, String clientId, List<String> scopes) async {
// create the client
var issuer = await Issuer.discover(uri);
var client = new Client(issuer, clientId);
// create an authenticator
var authenticator = new Authenticator(client, scopes: scopes);
// get the credential
var c = await authenticator.credential;
if (c==null) {
// starts the authentication
authenticator.authorize(); // this will redirect the browser
} else {
// return the user info
return await c.getUserInfo();
}
}
i think this has to do with your authorization server
I close this issue as this is probably not related to the package