Skip to content

🐛 [firebase_auth] Calling Apple Revoke Token endpoint #11065

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

Closed
huangbolaw opened this issue May 31, 2023 · 5 comments · Fixed by #11454
Closed

🐛 [firebase_auth] Calling Apple Revoke Token endpoint #11065

huangbolaw opened this issue May 31, 2023 · 5 comments · Fixed by #11454
Assignees
Labels
platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. plugin: auth resolution: fixed A fix has been merged or is pending merge from a PR. type: missing-feature A feature that is supported on the underlying Firebase SDK but has not been exposed to Dart API.

Comments

@huangbolaw
Copy link

Bug report

Describe the bug
Calling revoke token endpoint has been resolved in the firebase-ios-sdk:
firebase/firebase-ios-sdk#9906 (comment)

A "feature" request was submitted:
#10827

Respectfully, and apologies to be blunt, this should be a top priority bug rather than a feature request for flutter firebase_auth, because without this, making an iOS app using flutter is infeasible. Not supporting iOS for almost a year is unacceptable. I find no rationale to view this as something that is "nice to have".
https://developer.apple.com/news/?id=12m75xbj

Steps to reproduce

Steps to reproduce the behavior:

  1. Use firebase_auth to support signing in through AppleID
  2. No way to call the revoke token end point within firebase_auth

Expected behavior

FirebaseAuth.instance.currentUser!.revokeAppleToken() returns true and disconnect the Apple ID from the firebase app.

@huangbolaw huangbolaw added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels May 31, 2023
@huangbolaw huangbolaw changed the title 🐛 [firebase_auth] Calling an Apple Revoke Token endpoint 🐛 [firebase_auth] Calling Apple Revoke Token endpoint May 31, 2023
@danagbemava-nc danagbemava-nc added the triage Issue is currently being triaged. label May 31, 2023
@danagbemava-nc
Copy link

danagbemava-nc commented May 31, 2023

Hi @huangbolaw, a "feature" request was never filed on this repo. That was a discussion, which is entirely different from a feature request.

Thanks for drawing our attention to this feature.

cc @Lyokone

@danagbemava-nc danagbemava-nc added plugin: auth platform: ios Issues / PRs which are specifically for iOS. type: missing-feature A feature that is supported on the underlying Firebase SDK but has not been exposed to Dart API. and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. type: bug Something isn't working labels May 31, 2023
@huangbolaw
Copy link
Author

For people out there, while waiting for this feature, consider using the sign_in_with_apple package (at https://pub.dev/packages/sign_in_with_apple), which works.

Firebase Function

See the following re implementation of a firebase function which, if provided with the authorizationCode, would (1) obtain a refresh token using the authorization code and (2) then revoke the refresh token:
https://github.com/jooyoungho/apple-token-revoke-in-firebase
Ref: firebase/firebase-ios-sdk#9906 (comment)

Client Side

Once you have the firebase function up and running, you can do the following on the app (client side) to obtain authorization code using sign_in_with_apple and then call the function:

final AuthorizationCredentialAppleID credential =
   await SignInWithApple.getAppleIDCredential(
      scopes: [
         AppleIDAuthorizationScopes.email,
         AppleIDAuthorizationScopes.fullName,
     ],
   );

Map<String, String> payload = {'token': credential.authorizationCode};
HttpsCallable revokeToken = FirebaseFunctions.instance.httpsCallable("revokeToken");

try {
   revokeToken.call(payload);
} catch (exception, stack) {
   // Deal with errors
}

@ChiaraMC
Copy link

Hey @danagbemava-nc is it possible to know if this issue is actively being worked on (and if so, if there's an estimate of when it might be fixed) or if it's been put in a backlog?

@darshankawar
Copy link

Added android label based on #11396 (comment)

@ChiaraMC
Copy link

Thanks for this @russellwheatley ! Really appreciated

@danagbemava-nc danagbemava-nc added the resolution: fixed A fix has been merged or is pending merge from a PR. label Aug 24, 2023
@firebase firebase locked and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. plugin: auth resolution: fixed A fix has been merged or is pending merge from a PR. type: missing-feature A feature that is supported on the underlying Firebase SDK but has not been exposed to Dart API.
Projects
None yet
5 participants