Skip to content

Requesting multiple tokens with different scopes #1252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
eddyuk opened this issue Aug 31, 2022 · 4 comments
Open

Requesting multiple tokens with different scopes #1252

eddyuk opened this issue Aug 31, 2022 · 4 comments
Labels
question For tagging support requests and general questions.

Comments

@eddyuk
Copy link

eddyuk commented Aug 31, 2022

Hi,
In our application we need to produce different tokens for same client id but different scopes (PKCE flow).
I tried to create 2 different instances of OAuthService when both sharing same configuration but each have different scopes. The token that returned is same token. Is that achievable somehow?
Thanks

@jeroenheijmans jeroenheijmans added the question For tagging support requests and general questions. label Aug 31, 2022
@jeroenheijmans
Copy link
Collaborator

This is not easily achieved with this library. It's set up as a singleton service with a singleton configuration, having either 0 or 1 sets of id/access tokens. Doing multiple instances and multiple access tokens for separate scenario's is in my opinion not a real strong suit (though maybe it can be get to work), so I'd recommend looking elsewhere for that use case.

@majkers
Copy link

majkers commented Jan 16, 2023

@eddyuk Hi there. Did you find any solution to your problem. I am also having similar issue. I use PKCE flow but inside my app I have a create signature functionality and during that process second user (not the one that authorized himself before) has to authorize himself. I tired to use fetchTokenUsingPasswordFlow method with different credentails but after successful login my original user becomes the one that just authorized just for the signature...
@jeroenheijmans maybe some tip how to get it done?

@jeroenheijmans
Copy link
Collaborator

Sorry, I can only reiterate my previous comment: don't use this library for that scenario. It's in my opinion currently not suited for this situation, even with workarounds and customization.

PS. See also #1280, I'm quite a bit less involved with the library nowadays (just as a heads up).

@eddyuk
Copy link
Author

eddyuk commented Jan 16, 2023

The solution I have in mind, is eventually to retrieve a token from backend service with different client (for my scenario it is suitable). With the library I only login the working user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question For tagging support requests and general questions.
Projects
None yet
Development

No branches or pull requests

3 participants