openid_client icon indicating copy to clipboard operation
openid_client copied to clipboard

Issue , integrating flutter web app with ForgeRock

Open sarat12us opened this issue 4 years ago • 1 comments

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();
    }
}

sarat12us avatar Sep 22 '20 05:09 sarat12us

i think this has to do with your authorization server

FrankDupree avatar Oct 01 '20 07:10 FrankDupree

I close this issue as this is probably not related to the package

rbellens avatar Dec 31 '22 15:12 rbellens