-
Notifications
You must be signed in to change notification settings - Fork 46
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
How can I get Google authURL? #38
Comments
The I have outlined how to actually authenticate the user in the Google auth guide. Basically you register the auth route like this: try router.oAuth(from: Google.self, authenticate: "google", callback: "http://localhost:8080/google-complete") Then the client can go to the |
Ok I see, thanks for your awnser. try router.oAuth(from: Google.self, authenticate: "google", callback: "http://localhost:8080/google-complete", scope: ["https://www.googleapis.com/auth/cloud-platform"]) { (request, token) in
print(token)
return request.future(request.redirect(to: "/"))
} And let protected = router.grouped(ImperialMiddleware())
protected.get("hello") { req in
return "Hello, world!"
} And I get If I need to create this route, how I can get the Thanks you, for the project and your quick response! |
The |
OK, thanks for the details! |
Hi,
I have setup like indicated in the Google guide.
When I'm adding a route in an protected route (with
ImperialMiddleware
) , I get following messageUser currently not authenticated
. But, I want to redirect the user to the Google Login Page, for authentification.But, I can not access to
authURL
inGoogleRouter
for set this value inImperialMiddleware(redirect: <#T##String?#>)
. How can I do it?Thanks.
The text was updated successfully, but these errors were encountered: