firebase / firebase/firebase-ios-sdk
Sign In With Apple revokeToken returns an error occurred in Auth Emulator
- Dominant language
- C++
- Stars
- 6.7k
- Forks
- 1.8k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 72
Description
### Description
Hi, there.
I wrote revoking token flow that read [this guide](https://firebase.google.com/docs/auth/ios/apple?hl=ja&authuser=0#token_revocation). and I have observed revokeToken is working successfully in the real Firebase Auth (production) environment. However, when I try to use `revokeToken` with the emulator environment, it does not succeed and error.
I have shared the code [here](https://gist.github.com/hulk510/7f13636d79d823adba609304b61bd040).

### Expected Behavior
I expect the revokeToken function to succeed when used in the emulator environment. It should function in a similar manner to the real Firebase Auth (production) environment.
If this behavior is not a bug and there is a specific configuration or workaround required for the emulator, I would greatly appreciate any guidance or comments you can provide.
Thank you for your attention to this matter. Please let me know if you require any additional information or clarification.
Best regards,
### Reproducing the issue
1. Sign in with Apple using the Firebase Emulator environment.
2. Run the following code: `Auth.auth().revokeToken(withAuthorizationCode: code)`.
### Firebase SDK Version
10.9.0
### Xcode Version
14.3.1(14E300c)
### Installation Method
Swift Package Manager
### Firebase Product(s)
Authentication
### Targeted Platforms
iOS
### Relevant Log Output
```shell
2023-06-23 13:51:52.070776+0900 [2212:397967] 10.9.0 - [FirebaseAuth][I-AUT000017] Has valid access token. Estimated expiration date: 2023-06-23 05:51:39 +0000, current date: 2023-06-23 04:51:52 +0000
2023-06-23 13:51:52.071260+0900 [2212:397967] 10.9.0 - [FirebaseAuth][I-AUT000017] Actual token expiration date: 2023-06-23 05:51:39 +0000, current date: 2023-06-23 04:51:52 +0000
Printing description of error:
Error Domain=FIRAuthErrorDomain Code=17004 "An internal error has occurred, print and inspect the error details for more information." UserInfo={NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., FIRAuthErrorUserInfoNameKey=ERROR_INVALID_CREDENTIAL}
An internal error has occurred, print and inspect the error details for more information.
2023-06-23 13:52:47.453173+0900 [2212:398085] [tcp] tcp_input [C3:2] flags=[R.] seq=2523658095, ack=653370711, win=2048 state=TIME_WAIT rcv_nxt=2523658095, snd_una=653370711
2023-06-23 13:52:47.455383+0900 [2212:398085] [tcp] tcp_input [C3:2] flags=[R] seq=2523658094, ack=0, win=0 state=TIME_WAIT rcv_nxt=2523658095, snd_una=653370711
2023-06-23 13:52:47.455656+0900 [2212:398085] [tcp] tcp_input [C3:2] flags=[R] seq=2523658094, ack=0, win=0 state=TIME_WAIT rcv_nxt=2523658095, snd_una=653370711
2023-06-23 13:52:47.456832+0900 [2212:398423] 10.9.0 - [FirebaseFirestore][I-FST000001] Committing transaction:
2023-06-23 13:52:47.456935+0900 [2212:398423] 10.9.0 - [FirebaseFirestore][I-FST000001] Garbage collection skipped; Cache size 21758 is lower than threshold 104857600
2023-06-23 13:52:47.457088+0900 [2212:398423] 10.9.0 - [FirebaseFirestore][I-FST000001] Committing transaction:
```
### If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
```json
{
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "a5f16ba68913840ee5df91b8dc06f5cc063579de",
"version" : "1.2021110200.0"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk.git",
"state" : {
"revision" : "4961c0b7eb5d794e47a58dbfdd258b4beca4263a",
"version" : "10.9.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "9209b95a2593985569918e5e5ee2bf4ef8ff3640",
"version" : "10.9.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "7874c1b48cbffd086ce8a052c4be873a78613775",
"version" : "9.2.3"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "871d43135925cde39ef7421d8723ce47edfdcc39",
"version" : "7.11.1"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "df37f6af8a273bc687e3166843ed86007de57d78",
"version" : "1.44.0"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "d415594121c9e8a4f9d79cecee0965cf35e74dbd",
"version" : "3.1.1"
}
},
{
"identity" : "leveldb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "0706abcc6b0bd9cedfbb015ba840e4a780b5159b",
"version" : "1.22.2"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692",
"version" : "2.30909.0"
}
},
{
"identity" : "promises",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "ec957ccddbcc710ccc64c9dcbd4c7006fcf8b73a",
"version" : "2.2.0"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "0af9125c4eae12a4973fb66574c53a54962a9e1e",
"version" : "1.21.0"
}
}
],
"version" : 2
}
```
### If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock snippet
```yml
Replace this line with the contents of your Podfile.lock!
```
Contributor guide
Assessment
This issue has not been assessed yet.