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

SignInWithIdToken not returning updated session #89

Closed
kaushalkumar86 opened this issue Apr 3, 2024 · 6 comments
Closed

SignInWithIdToken not returning updated session #89

kaushalkumar86 opened this issue Apr 3, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@kaushalkumar86
Copy link

when called

Session session = await supabase.Auth.SignInWithIdToken(Constants.Provider.Google, task.Result.IdToken);

the resultant session does not contain vales for Google provider, that is, the session value itself is not null but session.User.Identities does not contain anything, its count values is 0.

Have to use
supabase.Auth.LoadSession();
Session session = await supabase.Auth.RetrieveSessionAsync();

after signin to get proper updated session details with User.Identities to check for provider and its data.

@kaushalkumar86 kaushalkumar86 added the bug Something isn't working label Apr 3, 2024
@acupofjose
Copy link
Contributor

Hm interesting, I'll look into it!

acupofjose added a commit that referenced this issue Apr 5, 2024
@acupofjose
Copy link
Contributor

Can you check with v4.3.0 as to whether this issue has been resolved?

@kaushalkumar86
Copy link
Author

kaushalkumar86 commented Apr 5, 2024 via email

@kaushalkumar86
Copy link
Author

kaushalkumar86 commented Apr 5, 2024

Yes its working now and I am getting the updated session, thanks a lot.

Right now, I have made a java(aar) plugin for chrome tab (for android) to use it with Unity in order to signin to facebook via PKCE and deep linking, its working. Then i had to call fb graph api to get my access_token so that I can get user extra data like friends and all, it also works.
But the issue with this method is, I am limited to platform and dependent on chrome to be installed on the device.

I can see that you added facebook and azure support in signinwithidtoken, but gain, it has to be used with PKCE flow for facebook.

I hope that in future, supabase can support native signin for facebook and other social media.

Thanks a lot for your quick resolution.

acupofjose added a commit that referenced this issue Apr 5, 2024
@acupofjose
Copy link
Contributor

@kaushalkumar86 thanks for your patience on getting all that working! I refactored the SignInWithIdToken method, it was adding an access_token key to the body of the request even if the access_token was null. This hotfix is available in v4.3.1.

Our client will not be implementing platform dependent native sign-on - we are providing support for the developer to tie in native sign-in with their supabase instance. There are unfortunately just too many platforms with too many varying/exclusive requirements to include it within the client implementation itself. Outside of the browser, this will be through PKCE flows.

However, @wiverson has done a lot of the legwork in showing how you can do PKCE flows here. It's worth checking out!

Hope that helps,
Joseph

@kaushalkumar86
Copy link
Author

kaushalkumar86 commented Apr 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants