-
Notifications
You must be signed in to change notification settings - Fork 48
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
Value required for key 'access_token'. #80
Comments
If I add another route with the same address as `try routes.oAuth(from: Facebook.self, authenticate: "login-facebook", callback: facebookCallbackURL, scope: ["public_profile", "email"], completion: processFacebookLogin) routes.get("oauth", "facebook", use: getCode)` |
SigIn with Google creates the same error |
Hi!
|
Reopening as Imperial should handle this better regardless of what global settings people have |
Interestingly, I'm getting a 200 back, but it comes with an error:
I'm probably using the wrong client secret or id judging by the URI I get back... Edit: Yep, wrong client secret in my case |
I have almost the same issue.
Something wrong here? let githubMediaType = HTTPMediaType(type: "application", subType: "vnd.github+json")
ContentConfiguration.global.use(decoder: JSONDecoder(), for: githubMediaType)
ContentConfiguration.global.use(encoder: JSONEncoder(), for: githubMediaType) Based on Oauth 2.0 spec access token is not needed in step 5, but it is fetched and returned in step 7. |
Hi all, just wanted to say that I've unfortunately just lost an hour of debugging and stepping through a bunch of Imperial code to find this bug. I think it's a clear bug that encoders/decoders customised by the Vapor installation are being used for interaction with upstream APIs that have an entirely different set of compatibility requirements. It seems this affects at least Google and Facebook, and quite possibly others. This will probably need an extension to each of the providers for them to define their own content decoder, and then use that instead of the global one that is used implicitly by https://github.com/vapor/vapor/blob/main/Sources/Vapor/Content/ContentContainer.swift#L128. |
I get the same error as in the issue subject with Keycloak. Making the following change worked for me:
|
@0xTim, I dont see this above change for keycloak merged in main branch, I had the same issue and fixed by making this change locally. |
@bbatth I don't think a patch was ever raised |
Hey! Can you please tell me what is the problem?
I receive a response from FB and Google with the code but I cannot process it. The execution process is interrupted before reaching the last argument "completion" to process the incoming token and then get user data
try routes.oAuth(from: Facebook.self, authenticate: "login-facebook", callback: facebookCallbackURL, scope: ["public_profile", "email"], completion: processFacebookLogin)
The text was updated successfully, but these errors were encountered: