-
Notifications
You must be signed in to change notification settings - Fork 119
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
Way to login with google directly in the app instead of throwing to sign in with web UI #2457
Comments
Hi @SomnathS09, Please see our Please note, there are some limitations with this approach. You will not have access to Cognito User Pool's and refreshing tokens is a manual process. I hope this helps! |
@tylerjroach Thanks for answering and mentioning the limitations. And Yes, Actually I am looking for solution that will embed the user credentials into Amplify as simple as available with Amplify.Auth.SignIn(username, password) method; So that later I can access all id, access, refresh token and user details like Amplify.currentUser() as well. What is needed for this, please guide with your experience. |
@SomnathS09 In your initial comment, you mentioned only having At this time, for social providers, we provide the hosted ui experience or the |
@tylerjroach Yes, I am aware of You must have also used Android apps that provide direct native google sign-in, why don't Amplify focuses on it? |
@SomnathS09 thank you for clarifying -- we do not support this auth flow at this time. I'll mark this issue as a feature request. |
@tylerjroach @tjleing I'm thinking of the following approach :
can you please guide the step 2? it has become high priority for us to integrate direct google account sign-in feature. |
@SomnathS09 This approach would not work. The redirect code that goes into HostedUIRedirectActivity comes from Cognito, it does not come from Google. We do not yet support Google Native SDK Auth outside of |
Can you throw some light on: How does cognito generate this token? can I make some middleware server that calls to cognito endpoint for generating this token (maybe with some Google credentials) and receive the token? What's going on behind this Google-Cognito OAuth flow? And about limited to identityPool : if I get you correctly I cannot identify the user in User pool, because getting .currentUser will throw error right? It will be just temporary credentials? |
Following this as well. |
Funny, I tried to figure out how this works without amplify already. I thought, well let's debug through amplify, they do this somehow... |
@tylerjroach Do you have any news about this ? It's been 11 months now. |
@emmanuelHa Sign in with Google still requires
The Amplify Android team is still actively focused on the Kotlin Android developer experience. Please let us know what concerns you have from documentation. |
Hello @tylerjroach thank you for your answer.
Looks very simple right, but it would have been even better with a simple implementation of SignedInContent. What does it takes for people developing all the day on those topics ? Nothing
Would you have any idea what could be the missed configuration ? Now in the new version Gen 2: My last question is for the usage of a non Web page in the context of an android app. Sorry for all those questions, but if amplify teams want an adoption from kotlin developers, this subject has to be a non subject. |
Hi @emmanuelHa Let me try to address a few of these things that I can immediately answer, and then I'll forward concerns along to our product team.
|
@tylerjroach Thanks for your responses.
I get "Default Activity not found" error For Gen 2:
When do you think it could be GA ? |
@emmanuelHa You still need a main activity for your app that containing these intent filters:
The activity with these intent filters is the activity that is used to launch the app. That is the reason for your error. HostedUIRedirectActivity is an additional activity that needs to go in your manifest. |
Ok.
By the way when mainActivity calls signInWithSocialWebUI how is HostedUIRedirectActivity called ? Under the hood ? |
In AndroidManifest I had to remove the package to make the app launched. |
The Authenticator component does not need to take up the full screen. You can additionally add a button on the screen to sign in with Google (onClick to call HostedUIRedirectActivity is headless. It does not have a view. It is simply used to handle redirects that come from the browser. As for how hosted ui works:
If customer wants to sign out, a button needs to be provided to them where you call Q: "it possible to login with social provider and deal with two google emails" |
Thank you @tylerjroach I progress.
|
federateToIdentityPool has limitations. for example, app is not able to access S3 after calling federatedToIdentityPool(). |
Before opening, please confirm:
Language and Async Model
Kotlin, Kotlin - Coroutines
Amplify Categories
Authentication
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
https://adrianhall.github.io/android/2018/09/18/auth-with-aws-amplify-1/
Describe the feature request
There is no direct way to do federated login in Android, there is only 1 API i.e signInWithWebUi which throws user to a web page or custom web view.
As mentioned here : https://developers.google.com/identity/sign-in/android/backend-auth
We need a way to directly login in user with "sign-in with google" button, which talks to google OAuth server and login directly with Cognito. Please provide a direct API like Amplify.fedratedSignIn{provider : google} which handles all of those backend redirects and give the result as user.
Initialization steps (if applicable)
No response
Code Snippet
// Put your code below this line.
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: