IdentityModel / oidc-client-js

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
Apache License 2.0
2.43k stars 842 forks source link

Acquire API token #1297

Closed dkijkuit closed 3 years ago

dkijkuit commented 3 years ago

Authentication flow seems to work fine. But after authentication many frontends will need to acquire an authorization token to access a specific API. This seems to be an important missing feature, or did I miss something?

brockallen commented 3 years ago

I don't follow. The getUser returns the user and it has an access_token property.

dkijkuit commented 3 years ago

Yes it does, but in our case the this token does not contain the claims we need. Therefore we need to acquire an API auhtorization token to access a specific resource server. You could have many resource servers running many API's all having their own scope.

brockallen commented 3 years ago

This library isn't designed to be "multi-tenant" (for lack of a better word). But you could create multiple instances of the UserManager for each, and that might solve your problem.