Maybe I am doing something incorrectly but I try to use the browser authentication inside a flutter web application.
I get authenticated by, at least I think I am, because I get an id token. but do not get a expires_at/expires_in or refresh token.
What I understand from different sites is that you should not get a refresh token so that is ok?
Now when I try to get the user data like the code below I get an error: "Invalid argument: null".
I think that is because I haven't set the accessToken but I did not receive it.
My code:
import 'package:openid_client/openid_client_browser.dart' as openIdBrowser;
static const List<String> _scopes = ['openid', 'profile', 'email', 'roles'];
....
var authenticator = new openIdBrowser.Authenticator(this._client, scopes: _scopes);
_credential = await authenticator.credential;
if (_credential==null) {
// starts the authentication
authenticator.authorize(); // this will redirect the browser
}
print("Userinfo: ${await _credential.getUserInfo()}");
Is an id token what is needed or am I doing something wrong?
I am also using the library for the app version and that seems to work fine.
Maybe I am doing something incorrectly but I try to use the browser authentication inside a flutter web application.
I get authenticated by, at least I think I am, because I get an id token. but do not get a expires_at/expires_in or refresh token. What I understand from different sites is that you should not get a refresh token so that is ok?
Now when I try to get the user data like the code below I get an error: "Invalid argument: null". I think that is because I haven't set the accessToken but I did not receive it.
My code:
Is an id token what is needed or am I doing something wrong?
I am also using the library for the app version and that seems to work fine.
Tijs