Skip to content
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

WIP FEATURE: Show authentication screen if needed #132

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sebobo
Copy link
Member

@Sebobo Sebobo commented May 5, 2022

If the server throws AuthenticationRequired exceptions, those should also be handled by the client.

If the server throws AuthenticationRequired exceptions,
those should also be handled by the client.
@Sebobo Sebobo added the Feature A new feature label May 5, 2022
@Sebobo
Copy link
Member Author

Sebobo commented May 5, 2022

@kdambekalns with Johannes help I implemented a custom FlowError transformer for the GraphQL adapter.
I can now provide additional information based on the type & code of the security errors.
This works well, but I'm currently not sure how I get the authentication url from the WebRedirect entry point inside the FlowErrorTransform.
Do you have an idea?

@kdambekalns
Copy link
Member

This works well, but I'm currently not sure how I get the authentication url from the WebRedirect entry point inside the FlowErrorTransform. Do you have an idea?

Since the WebRedirect can build the needed URI, I'd say adding a new method there to provide the needed value would be the way to go. But you'd need "the request" for that, at least with the current code. Not sure how well that plays with the GrapQL request that would trigger such an error…

For the use case I need this for, no WebRedirect is involved, though. Have you thought about that? Or would I need to set up a "fake token" to play along? If so, how would it know which token to use? It would at least need to check the state of the token (and only use it's entrypoint when it's not authenticated.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants