Skip to content

Commit 899b49b

Browse files
renkelvinpaulb777
authored andcommitted
Revert "Add OIDC nonce support (#4051)" (#4068)
This reverts commit c2bc304.
1 parent 81789f2 commit 899b49b

15 files changed

+4
-294
lines changed

Example/Auth/Sample/MainViewController+Apple.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

Example/Auth/Sample/MainViewController+Apple.m

Lines changed: 0 additions & 129 deletions
This file was deleted.

Example/Auth/Sample/MainViewController.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#import "MainViewController.h"
1818
#import "MainViewController+App.h"
19-
#import "MainViewController+Apple.h"
2019
#import "MainViewController+Auth.h"
2120
#import "MainViewController+AutoTests.h"
2221
#import "MainViewController+Custom.h"
@@ -245,8 +244,6 @@ - (void)updateTable {
245244
[weakSelf googleAuthSection],
246245
// Facebook Auth
247246
[weakSelf facebookAuthSection],
248-
// Apple Auth
249-
[weakSelf appleAuthSection],
250247
// OAuth
251248
[weakSelf oAuthSection],
252249
// Custom Auth

Example/Firebase.xcodeproj/project.pbxproj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
40CC5510221B9B4700032423 /* CustomAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC5508221B9B4700032423 /* CustomAuthTests.m */; };
118118
40CC5512221B9B4700032423 /* AnonymousAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC550A221B9B4700032423 /* AnonymousAuthTests.m */; };
119119
40CC5513221B9B4700032423 /* FacebookAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC550B221B9B4700032423 /* FacebookAuthTests.m */; };
120-
40DED7BE2350F60300768D88 /* MainViewController+Apple.m in Sources */ = {isa = PBXBuildFile; fileRef = 40DED7BD2350F60200768D88 /* MainViewController+Apple.m */; };
121120
40EE3B822256B23200BE59CE /* MainViewController+GameCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 40EE3B812256B23200BE59CE /* MainViewController+GameCenter.m */; };
122121
40EE3B862256B5A000BE59CE /* MainViewController+Phone.m in Sources */ = {isa = PBXBuildFile; fileRef = 40EE3B852256B5A000BE59CE /* MainViewController+Phone.m */; };
123122
40EE3B892256B9A600BE59CE /* MainViewController+User.m in Sources */ = {isa = PBXBuildFile; fileRef = 40EE3B882256B9A600BE59CE /* MainViewController+User.m */; };
@@ -1083,8 +1082,6 @@
10831082
40CC550A221B9B4700032423 /* AnonymousAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnonymousAuthTests.m; sourceTree = "<group>"; };
10841083
40CC550B221B9B4700032423 /* FacebookAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacebookAuthTests.m; sourceTree = "<group>"; };
10851084
40CC550C221B9B4700032423 /* FIRAuthApiTestsBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIRAuthApiTestsBase.h; sourceTree = "<group>"; };
1086-
40DED7BC2350F60200768D88 /* MainViewController+Apple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Apple.h"; sourceTree = "<group>"; };
1087-
40DED7BD2350F60200768D88 /* MainViewController+Apple.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+Apple.m"; sourceTree = "<group>"; };
10881085
40EE3B802256B23200BE59CE /* MainViewController+GameCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MainViewController+GameCenter.h"; sourceTree = "<group>"; };
10891086
40EE3B812256B23200BE59CE /* MainViewController+GameCenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "MainViewController+GameCenter.m"; sourceTree = "<group>"; };
10901087
40EE3B832256B39800BE59CE /* MainViewController+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MainViewController+Internal.h"; sourceTree = "<group>"; };
@@ -2306,8 +2303,6 @@
23062303
DE26D1E81F70333E004AE1D3 /* MainViewController.xib */,
23072304
40EE3B8D2256C0AD00BE59CE /* MainViewController+App.h */,
23082305
40EE3B8E2256C0AD00BE59CE /* MainViewController+App.m */,
2309-
40DED7BC2350F60200768D88 /* MainViewController+Apple.h */,
2310-
40DED7BD2350F60200768D88 /* MainViewController+Apple.m */,
23112306
40EE3BA22256C8DD00BE59CE /* MainViewController+Auth.h */,
23122307
40EE3BA32256C8DE00BE59CE /* MainViewController+Auth.m */,
23132308
40EE3B902256C2E800BE59CE /* MainViewController+AutoTests.h */,
@@ -4819,7 +4814,6 @@
48194814
DE26D24E1F7039BC004AE1D3 /* UIViewController+Alerts.m in Sources */,
48204815
DE26D24B1F7039BC004AE1D3 /* MainViewController.m in Sources */,
48214816
40EE3BA02256C77200BE59CE /* MainViewController+Custom.m in Sources */,
4822-
40DED7BE2350F60300768D88 /* MainViewController+Apple.m in Sources */,
48234817
40EE3B8C2256BBB200BE59CE /* MainViewController+OOB.m in Sources */,
48244818
DE26D24A1F7039BC004AE1D3 /* main.m in Sources */,
48254819
DE26D2481F7039BC004AE1D3 /* FacebookAuthProvider.m in Sources */,
@@ -6859,7 +6853,7 @@
68596853
DEBUG_INFORMATION_FORMAT = dwarf;
68606854
DEVELOPMENT_TEAM = 4ANB9W7R3P;
68616855
GCC_C_LANGUAGE_STANDARD = gnu11;
6862-
INFOPLIST_FILE = $SRCROOT/DynamicLinks/FDLBuilderTestAppObjC/Info.plist;
6856+
INFOPLIST_FILE = "$SRCROOT/DynamicLinks/FDLBuilderTestAppObjC/Info.plist";
68636857
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
68646858
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
68656859
MTL_ENABLE_DEBUG_INFO = YES;
@@ -6893,7 +6887,7 @@
68936887
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
68946888
DEVELOPMENT_TEAM = 4ANB9W7R3P;
68956889
GCC_C_LANGUAGE_STANDARD = gnu11;
6896-
INFOPLIST_FILE = $SRCROOT/DynamicLinks/FDLBuilderTestAppObjC/Info.plist;
6890+
INFOPLIST_FILE = "$SRCROOT/DynamicLinks/FDLBuilderTestAppObjC/Info.plist";
68976891
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
68986892
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
68996893
MTL_ENABLE_DEBUG_INFO = NO;

Firebase/Auth/Source/AuthProvider/OAuth/FIROAuthCredential.m

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
@interface FIROAuthCredential ()
2828

29-
@property(nonatomic, nullable) NSString *rawNonce;
30-
3129
- (nullable instancetype)initWithProvider:(NSString *)provider NS_UNAVAILABLE;
3230

3331
@end
@@ -42,14 +40,12 @@ - (nullable instancetype)initWithProvider:(NSString *)provider {
4240

4341
- (instancetype)initWithProviderID:(NSString *)providerID
4442
IDToken:(nullable NSString *)IDToken
45-
rawNonce:(nullable NSString *)rawNonce
4643
accessToken:(nullable NSString *)accessToken
4744
secret:(nullable NSString *)secret
4845
pendingToken:(nullable NSString *)pendingToken {
4946
self = [super initWithProvider:providerID];
5047
if (self) {
5148
_IDToken = IDToken;
52-
_rawNonce = rawNonce;
5349
_accessToken = accessToken;
5450
_pendingToken = pendingToken;
5551
_secret = secret;
@@ -60,12 +56,8 @@ - (instancetype)initWithProviderID:(NSString *)providerID
6056
- (instancetype)initWithProviderID:(NSString *)providerID
6157
sessionID:(NSString *)sessionID
6258
OAuthResponseURLString:(NSString *)OAuthResponseURLString {
63-
self = [self initWithProviderID:providerID
64-
IDToken:nil
65-
rawNonce:nil
66-
accessToken:nil
67-
secret:nil
68-
pendingToken:nil];
59+
self =
60+
[self initWithProviderID:providerID IDToken:nil accessToken:nil secret:nil pendingToken:nil];
6961
if (self) {
7062
_OAuthResponseURLString = OAuthResponseURLString;
7163
_sessionID = sessionID;
@@ -79,7 +71,6 @@ - (nullable instancetype)initWithVerifyAssertionResponse:(FIRVerifyAssertionResp
7971
response.oauthSecretToken.length) {
8072
return [self initWithProviderID:response.providerID
8173
IDToken:response.oauthIDToken
82-
rawNonce:nil
8374
accessToken:response.oauthAccessToken
8475
secret:response.oauthSecretToken
8576
pendingToken:response.pendingToken];
@@ -89,7 +80,6 @@ - (nullable instancetype)initWithVerifyAssertionResponse:(FIRVerifyAssertionResp
8980

9081
- (void)prepareVerifyAssertionRequest:(FIRVerifyAssertionRequest *)request {
9182
request.providerIDToken = _IDToken;
92-
request.providerRawNonce = _rawNonce;
9383
request.providerAccessToken = _accessToken;
9484
request.requestURI = _OAuthResponseURLString;
9585
request.sessionID = _sessionID;
@@ -105,13 +95,11 @@ + (BOOL)supportsSecureCoding {
10595

10696
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
10797
NSString *IDToken = [aDecoder decodeObjectOfClass:[NSString class] forKey:@"IDToken"];
108-
NSString *rawNonce = [aDecoder decodeObjectOfClass:[NSString class] forKey:@"rawNonce"];
10998
NSString *accessToken = [aDecoder decodeObjectOfClass:[NSString class] forKey:@"accessToken"];
11099
NSString *pendingToken = [aDecoder decodeObjectOfClass:[NSString class] forKey:@"pendingToken"];
111100
NSString *secret = [aDecoder decodeObjectOfClass:[NSString class] forKey:@"secret"];
112101
self = [self initWithProviderID:self.provider
113102
IDToken:IDToken
114-
rawNonce:rawNonce
115103
accessToken:accessToken
116104
secret:secret
117105
pendingToken:pendingToken];
@@ -120,7 +108,6 @@ - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
120108

121109
- (void)encodeWithCoder:(NSCoder *)aCoder {
122110
[aCoder encodeObject:self.IDToken forKey:@"IDToken"];
123-
[aCoder encodeObject:self.IDToken forKey:@"rawNonce"];
124111
[aCoder encodeObject:self.accessToken forKey:@"accessToken"];
125112
[aCoder encodeObject:self.pendingToken forKey:@"pendingToken"];
126113
[aCoder encodeObject:self.secret forKey:@"secret"];

Firebase/Auth/Source/AuthProvider/OAuth/FIROAuthCredential_Internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ NS_ASSUME_NONNULL_BEGIN
4646
@brief Designated initializer.
4747
@param providerID The provider ID associated with the credential being created.
4848
@param IDToken The ID Token associated with the credential being created.
49-
@param rawNonce The raw nonce associated with the Auth credential being created.
5049
@param accessToken The access token associated with the credential being created.
5150
@param secret The secret associated with the credential being created.
5251
@param pendingToken The pending token associated with the credential being created.
5352
*/
5453
- (instancetype)initWithProviderID:(NSString *)providerID
5554
IDToken:(nullable NSString *)IDToken
56-
rawNonce:(nullable NSString *)rawNonce
5755
accessToken:(nullable NSString *)accessToken
5856
secret:(nullable NSString *)secret
5957
pendingToken:(nullable NSString *)pendingToken NS_DESIGNATED_INITIALIZER;

Firebase/Auth/Source/AuthProvider/OAuth/FIROAuthProvider.m

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ + (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
7171
accessToken:(nullable NSString *)accessToken {
7272
return [[FIROAuthCredential alloc] initWithProviderID:providerID
7373
IDToken:IDToken
74-
rawNonce:nil
7574
accessToken:accessToken
7675
secret:nil
7776
pendingToken:nil];
@@ -81,35 +80,11 @@ + (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
8180
accessToken:(NSString *)accessToken {
8281
return [[FIROAuthCredential alloc] initWithProviderID:providerID
8382
IDToken:nil
84-
rawNonce:nil
8583
accessToken:accessToken
8684
secret:nil
8785
pendingToken:nil];
8886
}
8987

90-
+ (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
91-
IDToken:(NSString *)IDToken
92-
rawNonce:(nullable NSString *)rawNonce
93-
accessToken:(nullable NSString *)accessToken {
94-
return [[FIROAuthCredential alloc] initWithProviderID:providerID
95-
IDToken:IDToken
96-
rawNonce:rawNonce
97-
accessToken:accessToken
98-
secret:nil
99-
pendingToken:nil];
100-
}
101-
102-
+ (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
103-
IDToken:(NSString *)IDToken
104-
rawNonce:(nullable NSString *)rawNonce {
105-
return [[FIROAuthCredential alloc] initWithProviderID:providerID
106-
IDToken:IDToken
107-
rawNonce:rawNonce
108-
accessToken:nil
109-
secret:nil
110-
pendingToken:nil];
111-
}
112-
11388
+ (instancetype)providerWithProviderID:(NSString *)providerID {
11489
return [[self alloc]initWithProviderID:providerID auth:[FIRAuth auth]];
11590
}

Firebase/Auth/Source/Backend/FIRAuthBackend.m

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,6 @@
342342
*/
343343
static NSString *const kSessionExpiredErrorMessage = @"SESSION_EXPIRED";
344344

345-
/** @var kMissingOrInvalidNonceErrorMessage
346-
@brief This is the error message the server will respond with if the nonce is missing or invalid.
347-
*/
348-
static NSString *const kMissingOrInvalidNonceErrorMessage = @"MISSING_OR_INVALID_NONCE";
349-
350345
/** @var kMissingAppTokenErrorMessage
351346
@brief This is the error message the server will respond with if the APNS token is missing in a
352347
verifyClient request.
@@ -1181,10 +1176,6 @@ + (nullable NSError *)clientErrorWithServerErrorMessage:(NSString *)serverErrorM
11811176
return [FIRAuthErrorUtils captchaCheckFailedErrorWithMessage:serverErrorMessage];
11821177
}
11831178

1184-
if ([shortErrorMessage isEqualToString:kMissingOrInvalidNonceErrorMessage]) {
1185-
return [FIRAuthErrorUtils missingOrInvalidNonceErrorWithMessage:serverDetailErrorMessage];
1186-
}
1187-
11881179
// In this case we handle an error that might be specified in the underlying errors dictionary,
11891180
// the error message in determined based on the @c reason key in the dictionary.
11901181
if (errorDictionary[kErrorsKey]) {

0 commit comments

Comments
 (0)