-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
feat(authentication): support OpenID Connect #275
Comments
Hi @robingenz, thanks for this amazing plugin! |
It seems like this should be easy to implement. I will add it to my todo list. |
Hi, first of all, thank you for your work on this project @robingenz! |
@s-frei There are various ways in which you can prioritize this issue, see After creating an issue. And yes, one of them is sponsoring. Feel free to send me an e-mail to support@capawesome.io if you’re interested. |
@robingenz just wrote a mail to get this going forward. @s-frei is a collegue of mine. |
So I've just put in some $$ to sponsor development of this issue. 👍 |
The first dev version is now available:
There are three new methods: import { FirebaseAuthentication } from '@capacitor-firebase/authentication';
// See https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseAuth#getPendingAuthResult()
const getPendingAuthResult = async () => {
const result = await FirebaseAuthentication.getPendingAuthResult();
return result.user;
};
const signInWithOpenIdConnect = async () => {
const result = await FirebaseAuthentication.signInWithOpenIdConnect({
providerId: 'oidc.example.com',
});
return result.user;
};
const linkWithOpenIdConnect = async () => {
const result = await FirebaseAuthentication.linkWithOpenIdConnect({
providerId: 'oidc.example.com',
});
return result.user;
}; I would love to get some feedback. |
Hi @robingenz that was quick, thank you! I will test it and provide feedback on monday 🙂 |
As far as I can tell The |
Well, on iOS the promise returns an error:
and on Android:
even tho I see following when launching the apps:
Seems like a caching problem, but I'm not managing to fix it... EDIT: |
@s-frei Thank you for your feedback!
You should call
Exactly.
Sorry, this was my fault. I just published a new version:
Make sure to run
It should already work on Android. 🤔 |
Now it works on iOS! The issue on Adnroid is unfortunately still the same. I completely rebuilt it an wiped the device data. It seems like the correct code is displayed in Android Studio and I also can find the |
@s-frei I will take another look at Android later. |
@s-frei Okay, i fixed one last issue. Now it should also work on Android:
|
@robingenz perfect, thank you! Will test it tomorrow. |
@robingenz ok, Android seems to work now! The application gets killed in the background, at least when the browser isn't set up yet. But I guess that is the point where |
@s-frei Exactly! Thanks for the update. |
@robingenz just encountered another error using the When there is no pending auth result retrieved at Line 29 in e4fee1e
the passed authResult is null and produces a NullPointerException herehttps://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthentication.java#L747
|
@s-frei Thank you for reporting this. I've just published a dev version with a fix:
|
@robingenz tested it and no more exceptions 👍🏽 Thank you! Unrelated: Found another nullability issue in the Line 22 in e4fee1e
JSONException https://stleary.github.io/JSON-java/org/json/JSONObject.html#getJSONObject-java.lang.String-). Was about to open a bug issue for that, but the effort (due to requirements) to report such a small bug seemed way to much for me.Edit: Well, I just noticed that there is another layer by capacitor for JSONObject and this could be just fixed using https://github.com/ionic-team/capacitor/blob/b32b5b17ed14bd43c846b3fcb930bfd88e245e40/android/capacitor/src/main/java/com/getcapacitor/JSObject.java#L90. I for sure could provide that, but have nothing to reference... |
@s-frei Thank you. I have also just fixed this and released a dev version:
In such an obvious case, you can simply skip the minimal, reproducible example etc.. However, I need this information for the majority of issues. |
Is your feature request related to a problem? Please describe:
firebase now supports custom OpenID and SAML providers
Describe the solution you'd like:
add a method like signInWithCustomProvider
Describe alternatives you've considered:
NA
Additional context:
Android implementation
IOS implementation
Web Implementation
The text was updated successfully, but these errors were encountered: