From 36c1df0c70324bc3a41ef96f9bb568670cc366d0 Mon Sep 17 00:00:00 2001 From: Vitalij Dadaschjanz Date: Mon, 26 Jun 2023 19:39:09 +0200 Subject: [PATCH 01/13] introduce addtional http headers to OIDTokenRequest (#770) Co-authored-by: Vitalij Dadaschjanz --- .../Source/AppAuthExampleViewController.m | 3 +- .../Source/AppAuthExampleViewController.m | 3 +- .../Source/AppAuthExampleViewController.swift | 3 +- .../AppAuthTVExampleViewController.m | 3 +- README.md | 3 +- Source/AppAuthCore/OIDAuthState.h | 31 +++++++++++ Source/AppAuthCore/OIDAuthState.m | 51 +++++++++++++++--- Source/AppAuthCore/OIDAuthorizationResponse.h | 4 +- Source/AppAuthCore/OIDAuthorizationResponse.m | 9 ++-- Source/AppAuthCore/OIDTokenRequest.h | 12 ++++- Source/AppAuthCore/OIDTokenRequest.m | 39 +++++++++++--- Source/AppAuthTV/OIDTVAuthorizationResponse.h | 19 +++++++ Source/AppAuthTV/OIDTVAuthorizationResponse.m | 29 +++++++++- Source/AppAuthTV/OIDTVTokenRequest.h | 13 +++-- Source/AppAuthTV/OIDTVTokenRequest.m | 13 ++++- .../OIDTVAuthorizationResponseTests.h | 6 +-- .../OIDTVAuthorizationResponseTests.m | 20 +++++-- UnitTests/AppAuthTV/OIDTVTokenRequestTests.m | 13 ++++- UnitTests/OIDAuthStateTests.m | 21 ++++++++ UnitTests/OIDTokenRequestTests.m | 54 ++++++++++++++++--- 20 files changed, 303 insertions(+), 46 deletions(-) diff --git a/Examples/Example-iOS_ObjC-Carthage/Source/AppAuthExampleViewController.m b/Examples/Example-iOS_ObjC-Carthage/Source/AppAuthExampleViewController.m index dc76a8c9c..4d58cf9d2 100644 --- a/Examples/Example-iOS_ObjC-Carthage/Source/AppAuthExampleViewController.m +++ b/Examples/Example-iOS_ObjC-Carthage/Source/AppAuthExampleViewController.m @@ -177,7 +177,8 @@ - (void)doClientRegistration:(OIDServiceConfiguration *)configuration grantTypes:nil subjectType:nil tokenEndpointAuthMethod:@"client_secret_post" - additionalParameters:nil]; + additionalParameters:nil + additionalHeaders:nil]; // performs registration request [self logMessage:@"Initiating registration request"]; diff --git a/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m b/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m index 2c3ebe03e..d67c7b73d 100644 --- a/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m +++ b/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m @@ -179,7 +179,8 @@ - (void)doClientRegistration:(OIDServiceConfiguration *)configuration grantTypes:nil subjectType:nil tokenEndpointAuthMethod:@"client_secret_post" - additionalParameters:nil]; + additionalParameters:nil + additionalHeaders:nil]; // performs registration request [self logMessage:@"Initiating registration request"]; diff --git a/Examples/Example-iOS_Swift-Carthage/Source/AppAuthExampleViewController.swift b/Examples/Example-iOS_Swift-Carthage/Source/AppAuthExampleViewController.swift index f70540472..91cf79fa4 100644 --- a/Examples/Example-iOS_Swift-Carthage/Source/AppAuthExampleViewController.swift +++ b/Examples/Example-iOS_Swift-Carthage/Source/AppAuthExampleViewController.swift @@ -349,7 +349,8 @@ extension AppAuthExampleViewController { grantTypes: nil, subjectType: nil, tokenEndpointAuthMethod: "client_secret_post", - additionalParameters: nil) + additionalParameters: nil, + additionalHeaders: nil) // performs registration request self.logMessage("Initiating registration request") diff --git a/Examples/Example-tvOS/Example-tvOS/AppAuthTVExampleViewController.m b/Examples/Example-tvOS/Example-tvOS/AppAuthTVExampleViewController.m index 3d461619d..e97b0d204 100644 --- a/Examples/Example-tvOS/Example-tvOS/AppAuthTVExampleViewController.m +++ b/Examples/Example-tvOS/Example-tvOS/AppAuthTVExampleViewController.m @@ -176,7 +176,8 @@ - (void)performAuthorizationWithConfiguration:(OIDTVServiceConfiguration *)confi clientId:kClientID clientSecret:kClientSecret scopes:@[ OIDScopeOpenID, OIDScopeProfile ] - additionalParameters:nil]; + additionalParameters:nil + additionalHeaders:nil]; OIDTVAuthorizationInitialization initBlock = ^(OIDTVAuthorizationResponse *_Nullable response, NSError *_Nullable error) { diff --git a/README.md b/README.md index 78f79959f..53085b3c4 100644 --- a/README.md +++ b/README.md @@ -516,7 +516,8 @@ OIDTVAuthorizationRequest *request = clientId:kClientID clientSecret:kClientSecret scopes:@[ OIDScopeOpenID, OIDScopeProfile ] - additionalParameters:nil]; + additionalParameters:nil + additionalHeaders:nil]; // performs authentication request OIDTVAuthorizationInitialization initBlock = diff --git a/Source/AppAuthCore/OIDAuthState.h b/Source/AppAuthCore/OIDAuthState.h index 68697d2ca..46c78a831 100644 --- a/Source/AppAuthCore/OIDAuthState.h +++ b/Source/AppAuthCore/OIDAuthState.h @@ -48,6 +48,12 @@ typedef void (^OIDAuthStateAction)(NSString *_Nullable accessToken, typedef void (^OIDAuthStateAuthorizationCallback)(OIDAuthState *_Nullable authState, NSError *_Nullable error); +/*! @brief The exception thrown when a developer tries to create a refresh request from an + authorization request with no authorization code. + */ +static NSString *const kRefreshTokenRequestException = + @"Attempted to create a token refresh request from a token response with no refresh token."; + /*! @brief A convenience class that retains the auth state between @c OIDAuthorizationResponse%s and @c OIDTokenResponse%s. */ @@ -267,6 +273,31 @@ typedef void (^OIDAuthStateAuthorizationCallback)(OIDAuthState *_Nullable authSt - (nullable OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters: (nullable NSDictionary *)additionalParameters; +/*! @brief Creates a token request suitable for refreshing an access token. + @param additionalParameters Additional parameters for the token request. + @param additionalHeaders Additional headers for the token request. + @return A @c OIDTokenRequest suitable for using a refresh token to obtain a new access token. + @discussion After performing the refresh, call @c OIDAuthState.updateWithTokenResponse:error: + to update the authorization state based on the response. Rather than doing the token refresh + yourself, you should use @c OIDAuthState.performActionWithFreshTokens:. + @see https://tools.ietf.org/html/rfc6749#section-1.5 + */ +- (nullable OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters: + (nullable NSDictionary *)additionalParameters + additionalHeaders: + (nullable NSDictionary *)additionalHeaders; + +/*! @brief Creates a token request suitable for refreshing an access token. + @param additionalHeaders Additional parameters for the token request. + @return A @c OIDTokenRequest suitable for using a refresh token to obtain a new access token. + @discussion After performing the refresh, call @c OIDAuthState.updateWithTokenResponse:error: + to update the authorization state based on the response. Rather than doing the token refresh + yourself, you should use @c OIDAuthState.performActionWithFreshTokens:. + @see https://tools.ietf.org/html/rfc6749#section-1.5 + */ +- (nullable OIDTokenRequest *)tokenRefreshRequestWithAdditionalHeaders: + (nullable NSDictionary *)additionalHeaders; + @end NS_ASSUME_NONNULL_END diff --git a/Source/AppAuthCore/OIDAuthState.m b/Source/AppAuthCore/OIDAuthState.m index fe8a16221..cb5a22a1e 100644 --- a/Source/AppAuthCore/OIDAuthState.m +++ b/Source/AppAuthCore/OIDAuthState.m @@ -55,12 +55,6 @@ */ static NSString *const kAuthorizationErrorKey = @"authorizationError"; -/*! @brief The exception thrown when a developer tries to create a refresh request from an - authorization request with no authorization code. - */ -static NSString *const kRefreshTokenRequestException = - @"Attempted to create a token refresh request from a token response with no refresh token."; - /*! @brief Number of seconds the access token is refreshed before it actually expires. */ static const NSUInteger kExpiryTimeTolerance = 60; @@ -427,7 +421,47 @@ - (OIDTokenRequest *)tokenRefreshRequest { - (OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters: (NSDictionary *)additionalParameters { - // TODO: Add unit test to confirm exception is thrown when expected + if (!_refreshToken) { + [OIDErrorUtilities raiseException:kRefreshTokenRequestException]; + } + return [[OIDTokenRequest alloc] + initWithConfiguration:_lastAuthorizationResponse.request.configuration + grantType:OIDGrantTypeRefreshToken + authorizationCode:nil + redirectURL:nil + clientID:_lastAuthorizationResponse.request.clientID + clientSecret:_lastAuthorizationResponse.request.clientSecret + scope:nil + refreshToken:_refreshToken + codeVerifier:nil + additionalParameters:additionalParameters + additionalHeaders:nil]; +} + +- (OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters: + (NSDictionary *)additionalParameters + additionalHeaders: + (NSDictionary *)additionalHeaders { + + if (!_refreshToken) { + [OIDErrorUtilities raiseException:kRefreshTokenRequestException]; + } + return [[OIDTokenRequest alloc] + initWithConfiguration:_lastAuthorizationResponse.request.configuration + grantType:OIDGrantTypeRefreshToken + authorizationCode:nil + redirectURL:nil + clientID:_lastAuthorizationResponse.request.clientID + clientSecret:_lastAuthorizationResponse.request.clientSecret + scope:nil + refreshToken:_refreshToken + codeVerifier:nil + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; +} + +- (OIDTokenRequest *)tokenRefreshRequestWithAdditionalHeaders: + (NSDictionary *)additionalHeaders { if (!_refreshToken) { [OIDErrorUtilities raiseException:kRefreshTokenRequestException]; @@ -442,7 +476,8 @@ - (OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters: scope:nil refreshToken:_refreshToken codeVerifier:nil - additionalParameters:additionalParameters]; + additionalParameters:nil + additionalHeaders:additionalHeaders]; } #pragma mark - Stateful Actions diff --git a/Source/AppAuthCore/OIDAuthorizationResponse.h b/Source/AppAuthCore/OIDAuthorizationResponse.h index e7552fe59..2a10c81f2 100644 --- a/Source/AppAuthCore/OIDAuthorizationResponse.h +++ b/Source/AppAuthCore/OIDAuthorizationResponse.h @@ -121,7 +121,9 @@ NS_ASSUME_NONNULL_BEGIN @see https://tools.ietf.org/html/rfc6749#section-4.1.3 */ - (nullable OIDTokenRequest *)tokenExchangeRequestWithAdditionalParameters: - (nullable NSDictionary *)additionalParameters; + (nullable NSDictionary *)additionalParameters + additionalHeaders: + (nullable NSDictionary *)additionalHeaders; @end diff --git a/Source/AppAuthCore/OIDAuthorizationResponse.m b/Source/AppAuthCore/OIDAuthorizationResponse.m index a8f92c75e..5c998a966 100644 --- a/Source/AppAuthCore/OIDAuthorizationResponse.m +++ b/Source/AppAuthCore/OIDAuthorizationResponse.m @@ -184,11 +184,13 @@ - (NSString *)description { #pragma mark - - (OIDTokenRequest *)tokenExchangeRequest { - return [self tokenExchangeRequestWithAdditionalParameters:nil]; + return [self tokenExchangeRequestWithAdditionalParameters:nil additionalHeaders:nil]; } - (OIDTokenRequest *)tokenExchangeRequestWithAdditionalParameters: - (NSDictionary *)additionalParameters { + (NSDictionary *)additionalParameters + additionalHeaders: + (NSDictionary *)additionalHeaders { // TODO: add a unit test to confirm exception is thrown when expected and the request is created // with the correct parameters. if (!_authorizationCode) { @@ -204,7 +206,8 @@ - (OIDTokenRequest *)tokenExchangeRequestWithAdditionalParameters: scope:nil refreshToken:nil codeVerifier:_request.codeVerifier - additionalParameters:additionalParameters]; + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; } @end diff --git a/Source/AppAuthCore/OIDTokenRequest.h b/Source/AppAuthCore/OIDTokenRequest.h index 399294e8c..1d161cd08 100644 --- a/Source/AppAuthCore/OIDTokenRequest.h +++ b/Source/AppAuthCore/OIDTokenRequest.h @@ -95,9 +95,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property(nonatomic, readonly, nullable) NSDictionary *additionalParameters; +/*! @brief The client's additional token request headers. + */ +@property(nonatomic, readonly, nullable) NSDictionary *additionalHeaders; + /*! @internal @brief Unavailable. Please use - initWithConfiguration:grantType:code:redirectURL:clientID:additionalParameters:. + initWithConfiguration:grantType:code:redirectURL:clientID:additionalParameters:additionalHeaders:. */ - (instancetype)init NS_UNAVAILABLE; @@ -113,6 +117,7 @@ NS_ASSUME_NONNULL_BEGIN @param refreshToken The refresh token. @param codeVerifier The PKCE code verifier. @param additionalParameters The client's additional token request parameters. + @param additionalHeaders The client's additional token request headers. */ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration grantType:(NSString *)grantType @@ -123,7 +128,8 @@ NS_ASSUME_NONNULL_BEGIN scopes:(nullable NSArray *)scopes refreshToken:(nullable NSString *)refreshToken codeVerifier:(nullable NSString *)codeVerifier - additionalParameters:(nullable NSDictionary *)additionalParameters; + additionalParameters:(nullable NSDictionary *)additionalParameters + additionalHeaders:(nullable NSDictionary *)additionalHeaders; /*! @brief Designated initializer. @param configuration The service's configuration. @@ -139,6 +145,7 @@ NS_ASSUME_NONNULL_BEGIN @param refreshToken The refresh token. @param codeVerifier The PKCE code verifier. @param additionalParameters The client's additional token request parameters. + @param additionalHeaders The client's additional token request headers. */ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration grantType:(NSString *)grantType @@ -150,6 +157,7 @@ NS_ASSUME_NONNULL_BEGIN refreshToken:(nullable NSString *)refreshToken codeVerifier:(nullable NSString *)codeVerifier additionalParameters:(nullable NSDictionary *)additionalParameters + additionalHeaders:(nullable NSDictionary *)additionalHeaders NS_DESIGNATED_INITIALIZER; /*! @brief Designated initializer for NSSecureCoding. diff --git a/Source/AppAuthCore/OIDTokenRequest.m b/Source/AppAuthCore/OIDTokenRequest.m index 5ed8a17ef..08b0dafec 100644 --- a/Source/AppAuthCore/OIDTokenRequest.m +++ b/Source/AppAuthCore/OIDTokenRequest.m @@ -67,6 +67,11 @@ */ static NSString *const kAdditionalParametersKey = @"additionalParameters"; +/*! @brief Key used to encode the @c additionalHeaders property for + @c NSSecureCoding + */ +static NSString *const kAdditionalHeadersKey = @"additionalHeaders"; + @implementation OIDTokenRequest - (instancetype)init @@ -80,7 +85,8 @@ - (instancetype)init scope: refreshToken: codeVerifier: - additionalParameters:) + additionalParameters: + additionalHeaders:) ) - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration @@ -92,7 +98,8 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration scopes:(nullable NSArray *)scopes refreshToken:(nullable NSString *)refreshToken codeVerifier:(nullable NSString *)codeVerifier - additionalParameters:(nullable NSDictionary *)additionalParameters { + additionalParameters:(nullable NSDictionary *)additionalParameters + additionalHeaders:(nullable NSDictionary *)additionalHeaders { return [self initWithConfiguration:configuration grantType:grantType authorizationCode:code @@ -102,7 +109,8 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration scope:[OIDScopeUtilities scopesWithArray:scopes] refreshToken:refreshToken codeVerifier:(NSString *)codeVerifier - additionalParameters:additionalParameters]; + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; } - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration @@ -114,7 +122,8 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration scope:(nullable NSString *)scope refreshToken:(nullable NSString *)refreshToken codeVerifier:(nullable NSString *)codeVerifier - additionalParameters:(nullable NSDictionary *)additionalParameters { + additionalParameters:(nullable NSDictionary *)additionalParameters + additionalHeaders:(nullable NSDictionary *)additionalHeaders { self = [super init]; if (self) { _configuration = [configuration copy]; @@ -128,6 +137,8 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration _codeVerifier = [codeVerifier copy]; _additionalParameters = [[NSDictionary alloc] initWithDictionary:additionalParameters copyItems:YES]; + _additionalHeaders = + [[NSDictionary alloc] initWithDictionary:additionalHeaders copyItems:YES]; // Additional validation for the authorization_code grant type if ([_grantType isEqual:OIDGrantTypeAuthorizationCode]) { @@ -174,9 +185,18 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { [NSDictionary class], [NSString class] ]]; + NSDictionary *additionalParameters = - [aDecoder decodeObjectOfClasses:additionalParameterCodingClasses - forKey:kAdditionalParametersKey]; + [aDecoder decodeObjectOfClasses:additionalParameterCodingClasses forKey:kAdditionalParametersKey]; + + + NSSet *additionalHeaderCodingClasses = [NSSet setWithArray:@[ + [NSDictionary class], + [NSString class] + ]]; + + NSDictionary *additionalHeaders = + [aDecoder decodeObjectOfClasses:additionalHeaderCodingClasses forKey:kAdditionalHeadersKey]; self = [super init]; if (self) { @@ -191,6 +211,8 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { _codeVerifier = [codeVerifier copy]; _additionalParameters = [[NSDictionary alloc] initWithDictionary:additionalParameters copyItems:YES]; + _additionalHeaders = + [[NSDictionary alloc] initWithDictionary:additionalHeaders copyItems:YES]; } return self; } @@ -206,6 +228,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { [aCoder encodeObject:_refreshToken forKey:kRefreshTokenKey]; [aCoder encodeObject:_codeVerifier forKey:kCodeVerifierKey]; [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey]; + [aCoder encodeObject:_additionalHeaders forKey:kAdditionalHeadersKey]; } #pragma mark - NSObject overrides @@ -305,6 +328,10 @@ - (NSURLRequest *)URLRequest { for (id header in httpHeaders) { [URLRequest setValue:httpHeaders[header] forHTTPHeaderField:header]; } + + for (id header in _additionalHeaders) { + [URLRequest setValue:httpHeaders[header] forHTTPHeaderField:header]; + } return URLRequest; } diff --git a/Source/AppAuthTV/OIDTVAuthorizationResponse.h b/Source/AppAuthTV/OIDTVAuthorizationResponse.h index d3bed1e97..c57847c6e 100644 --- a/Source/AppAuthTV/OIDTVAuthorizationResponse.h +++ b/Source/AppAuthTV/OIDTVAuthorizationResponse.h @@ -87,6 +87,25 @@ NS_ASSUME_NONNULL_BEGIN - (nullable OIDTVTokenRequest *)tokenPollRequestWithAdditionalParameters: (nullable NSDictionary *)additionalParameters; +/*! @brief Creates a token request suitable for polling the token endpoint with the @c deviceCode. + @param additionalHeaders Additional headers for the token request. + @return A @c OIDTVTokenRequest suitable for polling the token endpoint. + @see https://tools.ietf.org/html/rfc8628#section-3.4 + */ +- (nullable OIDTVTokenRequest *)tokenPollRequestWithAdditionalHeaders: + (nullable NSDictionary *)additionalHeaders; + +/*! @brief Creates a token request suitable for polling the token endpoint with the @c deviceCode. + @param additionalParameters Additional parameters for the token request. + @param additionalHeaders Additional headers for the token request. + @return A @c OIDTVTokenRequest suitable for polling the token endpoint. + @see https://tools.ietf.org/html/rfc8628#section-3.4 + */ +- (nullable OIDTVTokenRequest *)tokenPollRequestWithAdditionalParameters: + (nullable NSDictionary *)additionalParameters + additionalHeaders: + (nullable NSDictionary *)additionalHeaders; + @end NS_ASSUME_NONNULL_END diff --git a/Source/AppAuthTV/OIDTVAuthorizationResponse.m b/Source/AppAuthTV/OIDTVAuthorizationResponse.m index 71b9e8f04..b45fc85f3 100644 --- a/Source/AppAuthTV/OIDTVAuthorizationResponse.m +++ b/Source/AppAuthTV/OIDTVAuthorizationResponse.m @@ -149,7 +149,7 @@ - (NSString *)description { #pragma mark - - (OIDTVTokenRequest *)tokenPollRequest { - return [self tokenPollRequestWithAdditionalParameters:nil]; + return [self tokenPollRequestWithAdditionalParameters:nil additionalHeaders:nil]; } - (OIDTVTokenRequest *)tokenPollRequestWithAdditionalParameters: @@ -159,7 +159,32 @@ - (OIDTVTokenRequest *)tokenPollRequestWithAdditionalParameters: deviceCode:_deviceCode clientID:self.request.clientID clientSecret:self.request.clientSecret - additionalParameters:additionalParameters]; + additionalParameters:additionalParameters + additionalHeaders:nil]; +} + +- (OIDTVTokenRequest *)tokenPollRequestWithAdditionalHeaders: + (NSDictionary *)additionalHeaders { + return [[OIDTVTokenRequest alloc] + initWithConfiguration:(OIDTVServiceConfiguration *)self.request.configuration + deviceCode:_deviceCode + clientID:self.request.clientID + clientSecret:self.request.clientSecret + additionalParameters:nil + additionalHeaders:additionalHeaders]; +} + +- (OIDTVTokenRequest *)tokenPollRequestWithAdditionalParameters: + (NSDictionary *)additionalParameters + additionalHeaders: + (NSDictionary *)additionalHeaders { + return [[OIDTVTokenRequest alloc] + initWithConfiguration:(OIDTVServiceConfiguration *)self.request.configuration + deviceCode:_deviceCode + clientID:self.request.clientID + clientSecret:self.request.clientSecret + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; } @end diff --git a/Source/AppAuthTV/OIDTVTokenRequest.h b/Source/AppAuthTV/OIDTVTokenRequest.h index 5a81c7434..021dc9b9d 100644 --- a/Source/AppAuthTV/OIDTVTokenRequest.h +++ b/Source/AppAuthTV/OIDTVTokenRequest.h @@ -35,14 +35,14 @@ NS_ASSUME_NONNULL_BEGIN /*! @internal @brief Unavailable. Please use - @c initWithConfiguration:deviceCode:clientID:clientSecret:additionalParameters: + @c initWithConfiguration:deviceCode:clientID:clientSecret:additionalParameters:additionalHeaders: or @c initWithCoder:. */ - (instancetype)init NS_UNAVAILABLE; /*! @internal @brief Unavailable. Please use - @c initWithConfiguration:deviceCode:clientID:clientSecret:additionalParameters: + @c initWithConfiguration:deviceCode:clientID:clientSecret:additionalParameters:additionalHeaders: or @c initWithCoder:. */ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration @@ -56,11 +56,13 @@ NS_ASSUME_NONNULL_BEGIN codeVerifier:(nullable NSString *)codeVerifier additionalParameters: (nullable NSDictionary *)additionalParameters + additionalHeaders: + (nullable NSDictionary *)additionalHeaders NS_UNAVAILABLE; /*! @internal @brief Unavailable. Please use - @c initWithConfiguration:deviceCode:clientID:clientSecret:additionalParameters: + @c initWithConfiguration:deviceCode:clientID:clientSecret:additionalParameters:additionalHeaders: or @c initWithCoder:. */ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration @@ -74,6 +76,8 @@ NS_ASSUME_NONNULL_BEGIN codeVerifier:(nullable NSString *)codeVerifier additionalParameters: (nullable NSDictionary *)additionalParameters + additionalHeaders: + (nullable NSDictionary *)additionalHeaders NS_UNAVAILABLE; /*! @brief Designated initializer. @@ -82,6 +86,7 @@ NS_ASSUME_NONNULL_BEGIN @param clientID The client identifier. @param clientSecret The client secret (nullable). @param additionalParameters The client's additional token request parameters. + @param additionalHeaders The client's additional token request headers. */ - (instancetype)initWithConfiguration:(OIDTVServiceConfiguration *)configuration deviceCode:(NSString *)deviceCode @@ -89,6 +94,8 @@ NS_ASSUME_NONNULL_BEGIN clientSecret:(nullable NSString *)clientSecret additionalParameters: (nullable NSDictionary *)additionalParameters + additionalHeaders: + (nullable NSDictionary *)additionalHeaders NS_DESIGNATED_INITIALIZER; /*! @brief Designated initializer for NSSecureCoding. diff --git a/Source/AppAuthTV/OIDTVTokenRequest.m b/Source/AppAuthTV/OIDTVTokenRequest.m index 88874a817..ed5e4d3f2 100644 --- a/Source/AppAuthTV/OIDTVTokenRequest.m +++ b/Source/AppAuthTV/OIDTVTokenRequest.m @@ -43,6 +43,7 @@ - (instancetype)init OID_UNAVAILABLE_USE_INITIALIZER(@selector clientID: clientSecret: additionalParameters: + additionalHeaders: )) - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration @@ -56,12 +57,15 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration codeVerifier:(nullable NSString *)codeVerifier additionalParameters: (nullable NSDictionary *)additionalParameters + additionalHeaders: + (nullable NSDictionary *)additionalHeaders OID_UNAVAILABLE_USE_INITIALIZER(@selector (initWithConfiguration: deviceCode: clientID: clientSecret: additionalParameters: + additionalHeaders: )) - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration @@ -75,19 +79,23 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration codeVerifier:(nullable NSString *)codeVerifier additionalParameters: (nullable NSDictionary *)additionalParameters + additionalHeaders: + (nullable NSDictionary *)additionalHeaders OID_UNAVAILABLE_USE_INITIALIZER(@selector (initWithConfiguration: deviceCode: clientID: clientSecret: additionalParameters: + additionalHeaders: )) - (instancetype)initWithConfiguration:(OIDTVServiceConfiguration *)configuration deviceCode:(NSString *)deviceCode clientID:(NSString *)clientID clientSecret:(NSString *)clientSecret - additionalParameters:(NSDictionary *)additionalParameters { + additionalParameters:(NSDictionary *)additionalParameters + additionalHeaders:(NSDictionary *)additionalHeaders { self = [super initWithConfiguration:configuration grantType:kOIDTVDeviceTokenGrantType authorizationCode:nil @@ -97,7 +105,8 @@ - (instancetype)initWithConfiguration:(OIDTVServiceConfiguration *)configuration scope:nil refreshToken:nil codeVerifier:nil - additionalParameters:additionalParameters]; + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; if (self) { _deviceCode = [deviceCode copy]; diff --git a/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.h b/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.h index 32497c854..2ffbc5775 100644 --- a/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.h +++ b/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.h @@ -48,10 +48,10 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)testTokenPollRequest; -/*! @brief Tests the @c tokenPollRequestWithAdditionalParameters method with one additional - parameter. +/*! @brief Tests the @c testTokenPollRequestWithAdditionalParametersAdditionalHeaders method with one additional + parameter and one additional header. */ -- (void)testTokenPollRequestWithAdditionalParameters; +- (void)testTokenPollRequestWithAdditionalParametersAdditionalHeaders; @end diff --git a/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.m b/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.m index a6d1bb2f5..288228e88 100644 --- a/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.m +++ b/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.m @@ -45,6 +45,14 @@ */ static NSString *const kTestAdditionalParameterValue = @"1"; +/*! @brief Test key for the @c additionalHeaders property. + */ +static NSString *const kTestAdditionalHeaderKey = @"B"; + +/*! @brief Test value for the @c additionalHeaders property. + */ +static NSString *const kTestAdditionalHeaderValue = @"2"; + /*! @brief Test value for the @c clientID property. */ static NSString *const kTestClientID = @"ClientID"; @@ -262,22 +270,26 @@ - (void)testTokenPollRequest { XCTAssertEqualObjects(pollRequest.additionalParameters, @{}); } -/*! @brief Tests the @c tokenPollRequestWithAdditionalParameters method with one additional - parameter. +/*! @brief Tests the @c testTokenPollRequestWithAdditionalParametersAdditionalHeaders method with one additional + parameter and one additional header. */ -- (void)testTokenPollRequestWithAdditionalParameters { +- (void)testTokenPollRequestWithAdditionalParametersAdditionalHeaders { OIDTVAuthorizationResponse *testResponse = [self testAuthorizationResponse]; NSDictionary *testAdditionalParameters = @{kTestAdditionalParameterKey : kTestAdditionalParameterValue}; + + NSDictionary *testAdditionalHeaders = + @{kTestAdditionalHeaderKey : kTestAdditionalHeaderValue}; OIDTVTokenRequest *pollRequest = - [testResponse tokenPollRequestWithAdditionalParameters:testAdditionalParameters]; + [testResponse tokenPollRequestWithAdditionalParameters:testAdditionalParameters additionalHeaders:testAdditionalHeaders]; XCTAssertEqualObjects(pollRequest.deviceCode, kTestDeviceCode); XCTAssertEqualObjects(pollRequest.clientID, kTestClientID); XCTAssertEqualObjects(pollRequest.clientSecret, kTestClientSecret); XCTAssertEqualObjects(pollRequest.additionalParameters, testAdditionalParameters); + XCTAssertEqualObjects(pollRequest.additionalHeaders, testAdditionalHeaders); } @end diff --git a/UnitTests/AppAuthTV/OIDTVTokenRequestTests.m b/UnitTests/AppAuthTV/OIDTVTokenRequestTests.m index cf0bf4963..4778a227b 100644 --- a/UnitTests/AppAuthTV/OIDTVTokenRequestTests.m +++ b/UnitTests/AppAuthTV/OIDTVTokenRequestTests.m @@ -50,6 +50,14 @@ */ static NSString *const kTestAdditionalParameterValue = @"1"; +/*! @brief Test key for the @c additionalHeaders property. + */ +static NSString *const kTestAdditionalHeaderKey = @"B"; + +/*! @brief Test value for the @c additionalHeaders property. + */ +static NSString *const kTestAdditionalHeaderValue = @"2"; + /*! @brief Test key for the @c clientID parameter in the HTTP request. */ static NSString *const kTestClientIDKey = @"client_id"; @@ -121,7 +129,8 @@ - (OIDTVTokenRequest *)testTokenRequest { deviceCode:kDeviceCodeValue clientID:kTestClientID clientSecret:kTestClientSecret - additionalParameters:@{kTestAdditionalParameterKey : kTestAdditionalParameterValue}]; + additionalParameters:@{kTestAdditionalParameterKey : kTestAdditionalParameterValue} + additionalHeaders:@{kTestAdditionalHeaderKey : kTestAdditionalHeaderValue}]; } /*! @brief Tests the initializer @@ -139,6 +148,8 @@ - (void)testInitializer { XCTAssertEqualObjects(request.clientSecret, kTestClientSecret); XCTAssertEqualObjects(request.additionalParameters, @{kTestAdditionalParameterKey:kTestAdditionalParameterValue}); + XCTAssertEqualObjects(request.additionalHeaders, + @{kTestAdditionalHeaderKey:kTestAdditionalHeaderValue}); } /*! @brief Tests the @c NSCopying implementation by round-tripping an instance through the copying diff --git a/UnitTests/OIDAuthStateTests.m b/UnitTests/OIDAuthStateTests.m index 4d7c3a8b7..d12f2a831 100644 --- a/UnitTests/OIDAuthStateTests.m +++ b/UnitTests/OIDAuthStateTests.m @@ -435,6 +435,27 @@ - (void)testIsTokenFreshHandlesTokenWithoutExpirationTime { XCTAssertEqual([authState isTokenFresh], YES, @""); } +- (void)testThatRefreshTokenExceptionWillBeRaisedForTokenRequestWithAdditionalParameters { + OIDAuthState *authState = [[OIDAuthState alloc] initWithAuthorizationResponse:nil tokenResponse:nil registrationResponse:nil]; + XCTAssertThrowsSpecificNamed([authState tokenRefreshRequestWithAdditionalParameters:nil], + NSException, + kRefreshTokenRequestException); +} + +- (void)testThatRefreshTokenExceptionWillBeRaisedForTokenRequestWithAdditionalHeaders { + OIDAuthState *authState = [[OIDAuthState alloc] initWithAuthorizationResponse:nil tokenResponse:nil registrationResponse:nil]; + XCTAssertThrowsSpecificNamed([authState tokenRefreshRequestWithAdditionalHeaders:nil], + NSException, + kRefreshTokenRequestException); +} + +- (void)testThatRefreshTokenExceptionWillBeRaisedForTokenRequestWithAdditionalParametersAndHeaders { + OIDAuthState *authState = [[OIDAuthState alloc] initWithAuthorizationResponse:nil tokenResponse:nil registrationResponse:nil]; + XCTAssertThrowsSpecificNamed([authState tokenRefreshRequestWithAdditionalHeaders:nil], + NSException, + kRefreshTokenRequestException); +} + @end #pragma GCC diagnostic pop diff --git a/UnitTests/OIDTokenRequestTests.m b/UnitTests/OIDTokenRequestTests.m index 4211ef70a..2aa865238 100644 --- a/UnitTests/OIDTokenRequestTests.m +++ b/UnitTests/OIDTokenRequestTests.m @@ -48,6 +48,14 @@ */ static NSString *const kTestAdditionalParameterValue = @"1"; +/*! @brief Test key for the @c additionalHeaders property. + */ +static NSString *const kTestAdditionalHeaderKey = @"B"; + +/*! @brief Test value for the @c additionalHeaders property. + */ +static NSString *const kTestAdditionalHeaderValue = @"2"; + @implementation OIDTokenRequestTests + (OIDTokenRequest *)testInstance { @@ -56,6 +64,9 @@ + (OIDTokenRequest *)testInstance { [OIDScopeUtilities scopesArrayWithString:authResponse.request.scope]; NSDictionary *additionalParameters = @{ kTestAdditionalParameterKey : kTestAdditionalParameterValue }; + NSDictionary *additionalHeaders = + @{ kTestAdditionalHeaderKey : kTestAdditionalHeaderValue }; + OIDTokenRequest *request = [[OIDTokenRequest alloc] initWithConfiguration:authResponse.request.configuration grantType:OIDGrantTypeAuthorizationCode @@ -66,7 +77,8 @@ + (OIDTokenRequest *)testInstance { scopes:scopesArray refreshToken:kRefreshTokenTestValue codeVerifier:authResponse.request.codeVerifier - additionalParameters:additionalParameters]; + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; return request; } @@ -76,6 +88,9 @@ + (OIDTokenRequest *)testInstanceCodeExchange { [OIDScopeUtilities scopesArrayWithString:authResponse.request.scope]; NSDictionary *additionalParameters = @{ kTestAdditionalParameterKey : kTestAdditionalParameterValue }; + NSDictionary *additionalHeaders = + @{ kTestAdditionalHeaderKey : kTestAdditionalHeaderValue }; + OIDTokenRequest *request = [[OIDTokenRequest alloc] initWithConfiguration:authResponse.request.configuration grantType:OIDGrantTypeAuthorizationCode @@ -86,7 +101,8 @@ + (OIDTokenRequest *)testInstanceCodeExchange { scopes:scopesArray refreshToken:kRefreshTokenTestValue codeVerifier:authResponse.request.codeVerifier - additionalParameters:additionalParameters]; + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; return request; } @@ -96,6 +112,9 @@ + (OIDTokenRequest *)testInstanceCodeExchangeClientAuth { [OIDScopeUtilities scopesArrayWithString:authResponse.request.scope]; NSDictionary *additionalParameters = @{ kTestAdditionalParameterKey : kTestAdditionalParameterValue }; + NSDictionary *additionalHeaders = + @{ kTestAdditionalHeaderKey : kTestAdditionalHeaderValue }; + OIDTokenRequest *request = [[OIDTokenRequest alloc] initWithConfiguration:authResponse.request.configuration grantType:OIDGrantTypeAuthorizationCode @@ -106,7 +125,8 @@ + (OIDTokenRequest *)testInstanceCodeExchangeClientAuth { scopes:scopesArray refreshToken:kRefreshTokenTestValue codeVerifier:authResponse.request.codeVerifier - additionalParameters:additionalParameters]; + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; return request; } @@ -116,6 +136,9 @@ + (OIDTokenRequest *)testInstanceRefresh { [OIDScopeUtilities scopesArrayWithString:authResponse.request.scope]; NSDictionary *additionalParameters = @{ kTestAdditionalParameterKey : kTestAdditionalParameterValue }; + NSDictionary *additionalHeaders = + @{ kTestAdditionalHeaderKey : kTestAdditionalHeaderValue }; + OIDTokenRequest *request = [[OIDTokenRequest alloc] initWithConfiguration:authResponse.request.configuration grantType:OIDGrantTypeAuthorizationCode @@ -126,7 +149,8 @@ + (OIDTokenRequest *)testInstanceRefresh { scopes:scopesArray refreshToken:kRefreshTokenTestValue codeVerifier:authResponse.request.codeVerifier - additionalParameters:additionalParameters]; + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; return request; } @@ -157,11 +181,17 @@ - (void)testCopying { XCTAssertEqualObjects(request.codeVerifier, authResponse.request.codeVerifier, @"Request and response codeVerifiers should be equal."); XCTAssertNotNil(request.additionalParameters, - @"Request's additionalParameters field should not be nil."); + @"Request's additionalParameters field should not be nil."); XCTAssertEqualObjects(request.additionalParameters[kTestAdditionalParameterKey], kTestAdditionalParameterValue, @"The request's kTestAdditionalParameterKey additional parameter should " "be equal to kTestAdditionalParameterValue."); + XCTAssertNotNil(request.additionalHeaders, + @"Request's additionalHeaders field should not be nil."); + XCTAssertEqualObjects(request.additionalHeaders[kTestAdditionalHeaderKey], + kTestAdditionalHeaderValue, + @"The request's kTestAdditionalHeaderKey additional parameter should " + "be equal to kTestAdditionalHeaderValue."); OIDTokenRequest *requestCopy = [request copy]; @@ -181,6 +211,9 @@ - (void)testCopying { XCTAssertNotNil(requestCopy.additionalParameters, @""); XCTAssertEqualObjects(requestCopy.additionalParameters[kTestAdditionalParameterKey], kTestAdditionalParameterValue, @""); + XCTAssertNotNil(requestCopy.additionalHeaders, @""); + XCTAssertEqualObjects(requestCopy.additionalHeaders[kTestAdditionalHeaderKey], + kTestAdditionalHeaderValue, @""); } /*! @brief Tests the @c NSSecureCoding by round-tripping an instance through the coding process and @@ -203,6 +236,9 @@ - (void)testSecureCoding { XCTAssertNotNil(request.additionalParameters, @""); XCTAssertEqualObjects(request.additionalParameters[kTestAdditionalParameterKey], kTestAdditionalParameterValue, @""); + XCTAssertNotNil(request.additionalHeaders, @""); + XCTAssertEqualObjects(request.additionalHeaders[kTestAdditionalHeaderKey], + kTestAdditionalHeaderValue, @""); NSData *data = [NSKeyedArchiver archivedDataWithRootObject:request]; OIDTokenRequest *requestCopy = [NSKeyedUnarchiver unarchiveObjectWithData:data]; @@ -224,6 +260,9 @@ - (void)testSecureCoding { XCTAssertNotNil(requestCopy.additionalParameters, @""); XCTAssertEqualObjects(requestCopy.additionalParameters[kTestAdditionalParameterKey], kTestAdditionalParameterValue, @""); + XCTAssertNotNil(requestCopy.additionalHeaders, @""); + XCTAssertEqualObjects(requestCopy.additionalHeaders[kTestAdditionalHeaderKey], + kTestAdditionalHeaderValue, @""); } - (void)testURLRequestNoClientAuth { @@ -248,6 +287,8 @@ - (void)testAuthorizationCodeNullRedirectURL { [OIDScopeUtilities scopesArrayWithString:authResponse.request.scope]; NSDictionary *additionalParameters = @{ kTestAdditionalParameterKey : kTestAdditionalParameterValue }; + NSDictionary *additionalHeaders = + @{ kTestAdditionalHeaderKey : kTestAdditionalHeaderValue }; XCTAssertThrows([[OIDTokenRequest alloc] initWithConfiguration:authResponse.request.configuration grantType:OIDGrantTypeAuthorizationCode authorizationCode:authResponse.authorizationCode @@ -257,7 +298,8 @@ - (void)testAuthorizationCodeNullRedirectURL { scopes:scopesArray refreshToken:kRefreshTokenTestValue codeVerifier:authResponse.request.codeVerifier - additionalParameters:additionalParameters], @""); + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders], @""); } @end From b376a8719dd9e3067439580d3b2c8aded748827f Mon Sep 17 00:00:00 2001 From: Daniel Seither Date: Wed, 4 Oct 2023 17:46:23 +0200 Subject: [PATCH 02/13] Fix nullability annotation for -[OIDExternalUserAgentIOS init] (#727) --- Source/AppAuth/iOS/OIDExternalUserAgentIOS.h | 2 +- Source/AppAuth/iOS/OIDExternalUserAgentIOS.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h index ae0773c69..12abc203c 100644 --- a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h +++ b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN API_UNAVAILABLE(macCatalyst) @interface OIDExternalUserAgentIOS : NSObject -- (nullable instancetype)init API_AVAILABLE(ios(11)) +- (null_unspecified instancetype)init API_AVAILABLE(ios(11)) __deprecated_msg("This method will not work on iOS 13, use " "initWithPresentingViewController:presentingViewController"); diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m index eab7aa3cb..4a8cda0a3 100644 --- a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m +++ b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m @@ -55,7 +55,7 @@ @implementation OIDExternalUserAgentIOS { #pragma clang diagnostic pop } -- (nullable instancetype)init { +- (null_unspecified instancetype)init { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnonnull" return [self initWithPresentingViewController:nil]; From 8b437c47f46d505b7bf9a580626472b2568f38ce Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Wed, 18 Oct 2023 20:11:59 +0200 Subject: [PATCH 03/13] feat: allow custom nonce in OIDAuthorizationRequest (#788) --- Source/AppAuthCore/OIDAuthorizationRequest.h | 23 +++++++++++++++++ Source/AppAuthCore/OIDAuthorizationRequest.m | 26 ++++++++++++++++++++ UnitTests/OIDAuthorizationRequestTests.m | 23 +++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/Source/AppAuthCore/OIDAuthorizationRequest.h b/Source/AppAuthCore/OIDAuthorizationRequest.h index 594f01d87..c3a0cc0d8 100644 --- a/Source/AppAuthCore/OIDAuthorizationRequest.h +++ b/Source/AppAuthCore/OIDAuthorizationRequest.h @@ -159,6 +159,29 @@ extern NSString *const OIDOAuthorizationRequestCodeChallengeMethodS256; responseType:(NSString *)responseType additionalParameters:(nullable NSDictionary *)additionalParameters; +/*! @brief Creates an authorization request with custom nonce, a secure @c state, + and PKCE with S256 as the @c code_challenge_method. + @param configuration The service's configuration. + @param clientID The client identifier. + @param scopes An array of scopes to combine into a single scope string per the OAuth2 spec. + @param redirectURL The client's redirect URI. + @param responseType The expected response type. + @param nonce String value used to associate a Client session with an ID Token. Can be set to nil + if not using OpenID Connect, although pure OAuth servers should ignore params they don't + understand anyway. + @param additionalParameters The client's additional authorization parameters. + @remarks This convenience initializer generates a state parameter and PKCE challenges + automatically. + */ +- (instancetype) + initWithConfiguration:(OIDServiceConfiguration *)configuration + clientId:(NSString *)clientID + scopes:(nullable NSArray *)scopes + redirectURL:(NSURL *)redirectURL + responseType:(NSString *)responseType + nonce:(nullable NSString *)nonce + additionalParameters:(nullable NSDictionary *)additionalParameters; + /*! @brief Creates an authorization request with opinionated defaults (a secure @c state, @c nonce, and PKCE with S256 as the @c code_challenge_method). @param configuration The service's configuration. diff --git a/Source/AppAuthCore/OIDAuthorizationRequest.m b/Source/AppAuthCore/OIDAuthorizationRequest.m index ccfacda0f..1be1fdfde 100644 --- a/Source/AppAuthCore/OIDAuthorizationRequest.m +++ b/Source/AppAuthCore/OIDAuthorizationRequest.m @@ -202,6 +202,32 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration additionalParameters:additionalParameters]; } +- (instancetype) + initWithConfiguration:(OIDServiceConfiguration *)configuration + clientId:(NSString *)clientID + scopes:(nullable NSArray *)scopes + redirectURL:(NSURL *)redirectURL + responseType:(NSString *)responseType + nonce:(nullable NSString *)nonce + additionalParameters:(nullable NSDictionary *)additionalParameters { + // generates PKCE code verifier and challenge + NSString *codeVerifier = [[self class] generateCodeVerifier]; + NSString *codeChallenge = [[self class] codeChallengeS256ForVerifier:codeVerifier]; + + return [self initWithConfiguration:configuration + clientId:clientID + clientSecret:nil + scope:[OIDScopeUtilities scopesWithArray:scopes] + redirectURL:redirectURL + responseType:responseType + state:[[self class] generateState] + nonce:nonce + codeVerifier:codeVerifier + codeChallenge:codeChallenge + codeChallengeMethod:OIDOAuthorizationRequestCodeChallengeMethodS256 + additionalParameters:additionalParameters]; +} + #pragma mark - NSCopying - (instancetype)copyWithZone:(nullable NSZone *)zone { diff --git a/UnitTests/OIDAuthorizationRequestTests.m b/UnitTests/OIDAuthorizationRequestTests.m index 06bfc6c13..92ed8ee05 100644 --- a/UnitTests/OIDAuthorizationRequestTests.m +++ b/UnitTests/OIDAuthorizationRequestTests.m @@ -223,6 +223,29 @@ - (void)testScopeInitializerWithManyScopesAndNoClientSecret { kTestAdditionalParameterValue, @""); } + +/*! @brief Tests the initializer which takes a nonce + */ +- (void)testNonceInitializer { + OIDServiceConfiguration *configuration = [OIDServiceConfigurationTests testInstance]; + OIDAuthorizationRequest *request = + [[OIDAuthorizationRequest alloc] initWithConfiguration:configuration + clientId:kTestClientID + scopes:@[] + redirectURL:[NSURL URLWithString:kTestRedirectURL] + responseType:OIDResponseTypeCode + nonce:kTestNonce + additionalParameters:nil]; + + XCTAssertEqualObjects(request.nonce, kTestNonce); + XCTAssertEqualObjects(request.responseType, @"code"); + XCTAssertEqualObjects(request.scope, @""); + XCTAssertEqualObjects(request.clientID, kTestClientID); + XCTAssertNil(request.clientSecret); + XCTAssertEqualObjects(request.redirectURL, [NSURL URLWithString:kTestRedirectURL]); + XCTAssertEqualObjects(@(request.additionalParameters.count), @0); +} + - (void)testScopeInitializerWithManyScopesAndClientSecret { NSDictionary *additionalParameters = @{ kTestAdditionalParameterKey : kTestAdditionalParameterValue }; From aea7b8acd8b3fc261b8a42c998de33d76851f30b Mon Sep 17 00:00:00 2001 From: GravityByte Date: Wed, 25 Oct 2023 19:45:50 +0200 Subject: [PATCH 04/13] fixed wrong variable for additional http headers in OIDTokenRequest (#770) (#798) --- Source/AppAuthCore/OIDTokenRequest.m | 2 +- UnitTests/OIDTokenRequestTests.m | 53 ++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/Source/AppAuthCore/OIDTokenRequest.m b/Source/AppAuthCore/OIDTokenRequest.m index 08b0dafec..e09e5577d 100644 --- a/Source/AppAuthCore/OIDTokenRequest.m +++ b/Source/AppAuthCore/OIDTokenRequest.m @@ -330,7 +330,7 @@ - (NSURLRequest *)URLRequest { } for (id header in _additionalHeaders) { - [URLRequest setValue:httpHeaders[header] forHTTPHeaderField:header]; + [URLRequest setValue:_additionalHeaders[header] forHTTPHeaderField:header]; } return URLRequest; diff --git a/UnitTests/OIDTokenRequestTests.m b/UnitTests/OIDTokenRequestTests.m index 2aa865238..20ba691ca 100644 --- a/UnitTests/OIDTokenRequestTests.m +++ b/UnitTests/OIDTokenRequestTests.m @@ -56,6 +56,14 @@ */ static NSString *const kTestAdditionalHeaderValue = @"2"; +/*! @brief Test key for the @c additionalHeaders property. + */ +static NSString *const kTestAdditionalHeaderKey2 = @"C"; + +/*! @brief Test value for the @c additionalHeaders property. + */ +static NSString *const kTestAdditionalHeaderValue2 = @"3"; + @implementation OIDTokenRequestTests + (OIDTokenRequest *)testInstance { @@ -154,6 +162,32 @@ + (OIDTokenRequest *)testInstanceRefresh { return request; } ++ (OIDTokenRequest *)testInstanceAdditionalHeaders { + OIDAuthorizationResponse *authResponse = [OIDAuthorizationResponseTests testInstance]; + NSArray *scopesArray = + [OIDScopeUtilities scopesArrayWithString:authResponse.request.scope]; + NSDictionary *additionalParameters = + @{ kTestAdditionalParameterKey : kTestAdditionalParameterValue }; + NSDictionary *additionalHeaders = @{ + kTestAdditionalHeaderKey : kTestAdditionalHeaderValue, + kTestAdditionalHeaderKey2 : kTestAdditionalHeaderValue2 + }; + + OIDTokenRequest *request = + [[OIDTokenRequest alloc] initWithConfiguration:authResponse.request.configuration + grantType:OIDGrantTypeAuthorizationCode + authorizationCode:authResponse.authorizationCode + redirectURL:authResponse.request.redirectURL + clientID:authResponse.request.clientID + clientSecret:authResponse.request.clientSecret + scopes:scopesArray + refreshToken:kRefreshTokenTestValue + codeVerifier:authResponse.request.codeVerifier + additionalParameters:additionalParameters + additionalHeaders:additionalHeaders]; + return request; +} + /*! @brief Tests the @c NSCopying implementation by round-tripping an instance through the copying process and checking to make sure the source and destination instances are equivalent. */ @@ -239,6 +273,10 @@ - (void)testSecureCoding { XCTAssertNotNil(request.additionalHeaders, @""); XCTAssertEqualObjects(request.additionalHeaders[kTestAdditionalHeaderKey], kTestAdditionalHeaderValue, @""); + + NSURLRequest *urlRequest = [request URLRequest]; + XCTAssertEqualObjects([urlRequest.allHTTPHeaderFields objectForKey:kTestAdditionalHeaderKey], + kTestAdditionalHeaderValue); NSData *data = [NSKeyedArchiver archivedDataWithRootObject:request]; OIDTokenRequest *requestCopy = [NSKeyedUnarchiver unarchiveObjectWithData:data]; @@ -263,6 +301,10 @@ - (void)testSecureCoding { XCTAssertNotNil(requestCopy.additionalHeaders, @""); XCTAssertEqualObjects(requestCopy.additionalHeaders[kTestAdditionalHeaderKey], kTestAdditionalHeaderValue, @""); + + NSURLRequest *urlrequestCopy = [requestCopy URLRequest]; + XCTAssertEqualObjects([urlrequestCopy.allHTTPHeaderFields objectForKey:kTestAdditionalHeaderKey], + kTestAdditionalHeaderValue); } - (void)testURLRequestNoClientAuth { @@ -302,6 +344,17 @@ - (void)testAuthorizationCodeNullRedirectURL { additionalHeaders:additionalHeaders], @""); } +- (void)testThatAdditionalHeadersAreInTokenRequest { + OIDTokenRequest *request = [[self class] testInstanceAdditionalHeaders]; + NSURLRequest* urlRequest = [request URLRequest]; + + XCTAssertEqualObjects([urlRequest.allHTTPHeaderFields objectForKey:kTestAdditionalHeaderKey], + kTestAdditionalHeaderValue); + + XCTAssertEqualObjects([urlRequest.allHTTPHeaderFields objectForKey:kTestAdditionalHeaderKey2], + kTestAdditionalHeaderValue2); +} + @end #pragma GCC diagnostic pop From 3dc3e93eb165d2a1e18c4bc7e43864f5c9f96f14 Mon Sep 17 00:00:00 2001 From: mdmathias Date: Wed, 6 Mar 2024 12:47:12 -0800 Subject: [PATCH 05/13] Add privacy manifest (#822) --- AppAuth.podspec | 13 ++++- AppAuth.xcodeproj/project.pbxproj | 14 ++++++ .../project.pbxproj | 48 +++++++++++++------ Examples/Example-iOS_ObjC/Podfile | 4 +- .../Source/AppAuthExampleViewController.m | 7 +-- .../Example-macOS.xcodeproj/project.pbxproj | 32 ++++++------- Examples/Example-macOS/Podfile | 2 +- .../Example-tvOS.xcodeproj/project.pbxproj | 26 ++++++++-- .../AppAuthTVExampleViewController.m | 5 +- Examples/Example-tvOS/Podfile | 2 + Package.swift | 5 +- PrivacyInfo.xcprivacy | 18 +++++++ 12 files changed, 129 insertions(+), 47 deletions(-) create mode 100644 PrivacyInfo.xcprivacy diff --git a/AppAuth.podspec b/AppAuth.podspec index b175e6282..325690783 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -44,13 +44,19 @@ It follows the OAuth 2.0 for Native Apps best current practice # Subspec for the core AppAuth library classes only, suitable for extensions. s.subspec 'Core' do |core| core.source_files = "Source/AppAuthCore.h", "Source/AppAuthCore/*.{h,m}" + core.resource_bundles = { + "AppAuthCore_Privacy" => ["PrivacyInfo.xcprivacy"] + } end - # Subspec for the full AppAuth library, including platform-dependant external user agents. + # Subspec for the full AppAuth library, including platform-dependent external user agents. s.subspec 'ExternalUserAgent' do |externalUserAgent| externalUserAgent.dependency 'AppAuth/Core' externalUserAgent.source_files = "Source/AppAuth.h", "Source/AppAuth/*.{h,m}" + externalUserAgent.resource_bundles = { + "AppAuthExternalUserAgent_Privacy" => ["PrivacyInfo.xcprivacy"] + } # iOS externalUserAgent.ios.source_files = "Source/AppAuth/iOS/**/*.{h,m}" @@ -64,10 +70,13 @@ It follows the OAuth 2.0 for Native Apps best current practice externalUserAgent.osx.weak_frameworks = "AuthenticationServices" end - # Subspec for the full AppAuth library, including platform-dependant external user agents. + # Subspec for the full AppAuth library, including platform-dependent external user agents. s.subspec 'TV' do |tv| tv.source_files = "Source/AppAuthTV.h", "Source/AppAuthTV/*.{h,m}" tv.dependency 'AppAuth/Core' + tv.resource_bundles = { + "AppAuthTV" => ["PrivacyInfo.xcprivacy"] + } end s.default_subspecs = 'Core', 'ExternalUserAgent' diff --git a/AppAuth.xcodeproj/project.pbxproj b/AppAuth.xcodeproj/project.pbxproj index 08e6f28a1..1f4a2a876 100644 --- a/AppAuth.xcodeproj/project.pbxproj +++ b/AppAuth.xcodeproj/project.pbxproj @@ -546,6 +546,12 @@ 60140F801DE4344200DA0DC3 /* OIDRegistrationResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 60140F7F1DE4344200DA0DC3 /* OIDRegistrationResponse.m */; }; 60140F831DE43BAF00DA0DC3 /* OIDRegistrationRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 60140F821DE43BAF00DA0DC3 /* OIDRegistrationRequestTests.m */; }; 60140F861DE43CC700DA0DC3 /* OIDRegistrationResponseTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 60140F851DE43CC700DA0DC3 /* OIDRegistrationResponseTests.m */; }; + 73F574342B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */; }; + 73F574352B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */; }; + 73F574362B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */; }; + 73F574372B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */; }; + 73F574382B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */; }; + 73F574392B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */; }; A5EEF29720D821120044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; }; A5EEF29820D8211A0044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; }; A5EEF29920D8211B0044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; }; @@ -827,6 +833,7 @@ 60140F821DE43BAF00DA0DC3 /* OIDRegistrationRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDRegistrationRequestTests.m; sourceTree = ""; }; 60140F841DE43C8C00DA0DC3 /* OIDRegistrationResponseTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OIDRegistrationResponseTests.h; sourceTree = ""; }; 60140F851DE43CC700DA0DC3 /* OIDRegistrationResponseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDRegistrationResponseTests.m; sourceTree = ""; }; + 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OIDTokenUtilitiesTests.m; sourceTree = ""; }; A6CEB1172007E384009D492A /* OIDEndSessionRequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDEndSessionRequestTests.h; sourceTree = ""; }; A6CEB1182007E384009D492A /* OIDEndSessionRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDEndSessionRequestTests.m; sourceTree = ""; }; @@ -1048,6 +1055,7 @@ 340E73731C5D819B0076B1F6 = { isa = PBXGroup; children = ( + 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */, 341742291C5D84D0000EF209 /* Frameworks */, 341741FB1C5D82D3000EF209 /* UnitTests */, 341741AE1C5D8243000EF209 /* Source */, @@ -1937,6 +1945,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 73F574392B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1965,6 +1974,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 73F574382B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1972,6 +1982,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 73F574342B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1986,6 +1997,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 73F574352B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1993,6 +2005,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 73F574362B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2007,6 +2020,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 73F574372B7C42690023FFF0 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Examples/Example-iOS_ObjC/Example-iOS_ObjC.xcodeproj/project.pbxproj b/Examples/Example-iOS_ObjC/Example-iOS_ObjC.xcodeproj/project.pbxproj index eb38b576d..7f3f2de68 100644 --- a/Examples/Example-iOS_ObjC/Example-iOS_ObjC.xcodeproj/project.pbxproj +++ b/Examples/Example-iOS_ObjC/Example-iOS_ObjC.xcodeproj/project.pbxproj @@ -19,8 +19,8 @@ 346E91991C2A245000D3620B /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 346E91981C2A245000D3620B /* SafariServices.framework */; }; 34CB09BD1C42007600A54261 /* AppAuthExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34CB09BB1C42007600A54261 /* AppAuthExampleViewController.m */; }; 34CB09BE1C42007600A54261 /* AppAuthExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CB09BC1C42007600A54261 /* AppAuthExampleViewController.xib */; }; - D0B5FA33D74A6F7924A47471 /* libPods-Example-iOS_ObjC_Extension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 715EDB7EC4271193E47615ED /* libPods-Example-iOS_ObjC_Extension.a */; }; - E46F8589CE9E5DDFA69D835B /* libPods-Example-iOS_ObjC.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B61A918CBE7B8142CD7D8B3 /* libPods-Example-iOS_ObjC.a */; }; + BE28448F8FD76A9C12A30150 /* Pods_Example_iOS_ObjC_Extension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CC004951DF03519C52500EC /* Pods_Example_iOS_ObjC_Extension.framework */; }; + C46B36D00F282572B5747D71 /* Pods_Example_iOS_ObjC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43D84745AE558B974A2E64F7 /* Pods_Example_iOS_ObjC.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -81,9 +81,9 @@ 34CB09BB1C42007600A54261 /* AppAuthExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppAuthExampleViewController.m; sourceTree = ""; }; 34CB09BC1C42007600A54261 /* AppAuthExampleViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AppAuthExampleViewController.xib; sourceTree = ""; }; 3A18DF082AC2FA0980C9DE57 /* Pods-Example-iOS_ObjC_Extension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-iOS_ObjC_Extension.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example-iOS_ObjC_Extension/Pods-Example-iOS_ObjC_Extension.release.xcconfig"; sourceTree = ""; }; - 715EDB7EC4271193E47615ED /* libPods-Example-iOS_ObjC_Extension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-iOS_ObjC_Extension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3CC004951DF03519C52500EC /* Pods_Example_iOS_ObjC_Extension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_iOS_ObjC_Extension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 43D84745AE558B974A2E64F7 /* Pods_Example_iOS_ObjC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_iOS_ObjC.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 86C7660572AE6FF7A4D1592A /* Pods-Example-iOS_ObjC_Extension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-iOS_ObjC_Extension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example-iOS_ObjC_Extension/Pods-Example-iOS_ObjC_Extension.debug.xcconfig"; sourceTree = ""; }; - 8B61A918CBE7B8142CD7D8B3 /* libPods-Example-iOS_ObjC.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-iOS_ObjC.a"; sourceTree = BUILT_PRODUCTS_DIR; }; C4C31DB4A4928F246AA03805 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; D9867DC6FA9089CD613D4728 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; ECBCCC4A1A779C83C72044F2 /* Pods-Example-iOS_ObjC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-iOS_ObjC.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example-iOS_ObjC/Pods-Example-iOS_ObjC.release.xcconfig"; sourceTree = ""; }; @@ -95,7 +95,7 @@ buildActionMask = 2147483647; files = ( 06D4812F2055C3D400D9DC32 /* NotificationCenter.framework in Frameworks */, - D0B5FA33D74A6F7924A47471 /* libPods-Example-iOS_ObjC_Extension.a in Frameworks */, + BE28448F8FD76A9C12A30150 /* Pods_Example_iOS_ObjC_Extension.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -111,7 +111,7 @@ buildActionMask = 2147483647; files = ( 346E91991C2A245000D3620B /* SafariServices.framework in Frameworks */, - E46F8589CE9E5DDFA69D835B /* libPods-Example-iOS_ObjC.a in Frameworks */, + C46B36D00F282572B5747D71 /* Pods_Example_iOS_ObjC.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -145,9 +145,9 @@ 3474C8DD1DFCB08E00F22B34 /* libAppAuth-iOS.a */, 346E91981C2A245000D3620B /* SafariServices.framework */, 09795EAF079B07A1781675D9 /* libPods-Example.a */, - 8B61A918CBE7B8142CD7D8B3 /* libPods-Example-iOS_ObjC.a */, 06D4812E2055C3D400D9DC32 /* NotificationCenter.framework */, - 715EDB7EC4271193E47615ED /* libPods-Example-iOS_ObjC_Extension.a */, + 43D84745AE558B974A2E64F7 /* Pods_Example_iOS_ObjC.framework */, + 3CC004951DF03519C52500EC /* Pods_Example_iOS_ObjC_Extension.framework */, ); name = Frameworks; sourceTree = ""; @@ -252,6 +252,7 @@ 346E91661C29D42800D3620B /* Frameworks */, 346E91671C29D42800D3620B /* Resources */, 06D4813E2055C3D400D9DC32 /* Embed App Extensions */, + 0B7CB92A32140E833CA8FF89 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -301,6 +302,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -345,6 +347,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 0B7CB92A32140E833CA8FF89 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example-iOS_ObjC/Pods-Example-iOS_ObjC-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/AppAuth/AppAuth.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppAuth.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-iOS_ObjC/Pods-Example-iOS_ObjC-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 836219F293F319703A16E68D /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -468,7 +488,7 @@ DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Example-iOS_ObjC_Extension/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.appauth.Example.Example-iOS-ObjC-Extension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -500,7 +520,7 @@ DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Example-iOS_ObjC_Extension/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.appauth.Example.Example-iOS-ObjC-Extension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -520,7 +540,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = net.openid.AppAuthExampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -539,7 +559,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = net.openid.AppAuthExampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -642,7 +662,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Source/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = net.openid.appauth.Example; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -658,7 +678,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Source/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = net.openid.appauth.Example; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Examples/Example-iOS_ObjC/Podfile b/Examples/Example-iOS_ObjC/Podfile index a4354d010..600de7d10 100644 --- a/Examples/Example-iOS_ObjC/Podfile +++ b/Examples/Example-iOS_ObjC/Podfile @@ -1,4 +1,6 @@ -platform :ios, '9.0' +platform :ios, '11.0' + +use_frameworks! target 'Example-iOS_ObjC' do # AppAuth Pod diff --git a/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m b/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m index d67c7b73d..a4accb51b 100644 --- a/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m +++ b/Examples/Example-iOS_ObjC/Source/AppAuthExampleViewController.m @@ -179,9 +179,10 @@ - (void)doClientRegistration:(OIDServiceConfiguration *)configuration grantTypes:nil subjectType:nil tokenEndpointAuthMethod:@"client_secret_post" - additionalParameters:nil - additionalHeaders:nil]; - // performs registration request + initialAccessToken:nil + additionalParameters:nil]; + + // performs registration request [self logMessage:@"Initiating registration request"]; [OIDAuthorizationService performRegistrationRequest:request diff --git a/Examples/Example-macOS/Example-macOS.xcodeproj/project.pbxproj b/Examples/Example-macOS/Example-macOS.xcodeproj/project.pbxproj index 8990ba02e..13bb1c957 100644 --- a/Examples/Example-macOS/Example-macOS.xcodeproj/project.pbxproj +++ b/Examples/Example-macOS/Example-macOS.xcodeproj/project.pbxproj @@ -156,7 +156,6 @@ F6016E6C1D2AC11F003497D7 /* Sources */, F6016E6D1D2AC11F003497D7 /* Frameworks */, F6016E6E1D2AC11F003497D7 /* Resources */, - 52872C7E76CB3EA69F4392F7 /* [CP] Embed Pods Frameworks */, 1C5B2EF60536044DE119E500 /* [CP] Copy Pods Resources */, ); buildRules = ( @@ -192,6 +191,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -233,28 +233,18 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/AppAuth/AppAuthCore_Privacy.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/AppAuth/AppAuthExternalUserAgent_Privacy.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AppAuthCore_Privacy.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AppAuthExternalUserAgent_Privacy.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 52872C7E76CB3EA69F4392F7 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-resources.sh\"\n"; showEnvVarsInLog = 0; }; C9395BB900D0A44A3F7EB0BE /* [CP] Check Pods Manifest.lock */ = { @@ -263,13 +253,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-macOS-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -446,6 +439,7 @@ COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.appauth.Example-macOS"; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -459,6 +453,7 @@ COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.appauth.Example-macOS"; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -474,6 +469,7 @@ 341AA4C81E7F2E5000FCA5C6 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; F6016E6B1D2AC11E003497D7 /* Build configuration list for PBXProject "Example-macOS" */ = { isa = XCConfigurationList; diff --git a/Examples/Example-macOS/Podfile b/Examples/Example-macOS/Podfile index 5b8ce01ab..e0c0aced9 100644 --- a/Examples/Example-macOS/Podfile +++ b/Examples/Example-macOS/Podfile @@ -1,5 +1,5 @@ target 'Example-macOS' do - platform :osx, '10.10' + platform :osx, '10.12' # AppAuth Pod # In production, just use `pod 'AppAuth'` without the path reference. diff --git a/Examples/Example-tvOS/Example-tvOS.xcodeproj/project.pbxproj b/Examples/Example-tvOS/Example-tvOS.xcodeproj/project.pbxproj index c70129f75..b2e8a7d1a 100644 --- a/Examples/Example-tvOS/Example-tvOS.xcodeproj/project.pbxproj +++ b/Examples/Example-tvOS/Example-tvOS.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 2D91B7B0248EA17D0005B197 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2D91B7AF248EA17D0005B197 /* Assets.xcassets */; }; 2D91B7B3248EA17D0005B197 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2D91B7B1248EA17D0005B197 /* LaunchScreen.storyboard */; }; 2D91B7B6248EA17E0005B197 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D91B7B5248EA17E0005B197 /* main.m */; }; - 424A8D8BA4EB0A6C9FF4326A /* libPods-Example-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEBF9489D390F9D0913AE178 /* libPods-Example-tvOS.a */; }; + FEFBCAF105C70E934E5A4975 /* Pods_Example_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F58A1FCA981D60A0EA8A3E5A /* Pods_Example_tvOS.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -29,7 +29,7 @@ 2D91B7B4248EA17D0005B197 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 2D91B7B5248EA17E0005B197 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; D33A601E3AA7C8647C857C08 /* Pods-Example-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.debug.xcconfig"; sourceTree = ""; }; - EEBF9489D390F9D0913AE178 /* libPods-Example-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + F58A1FCA981D60A0EA8A3E5A /* Pods_Example_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -37,7 +37,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 424A8D8BA4EB0A6C9FF4326A /* libPods-Example-tvOS.a in Frameworks */, + FEFBCAF105C70E934E5A4975 /* Pods_Example_tvOS.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -81,7 +81,7 @@ 9CCA3BB0D6EA112455518E2C /* Frameworks */ = { isa = PBXGroup; children = ( - EEBF9489D390F9D0913AE178 /* libPods-Example-tvOS.a */, + F58A1FCA981D60A0EA8A3E5A /* Pods_Example_tvOS.framework */, ); name = Frameworks; sourceTree = ""; @@ -106,6 +106,7 @@ 2D91B79F248EA17C0005B197 /* Sources */, 2D91B7A0248EA17C0005B197 /* Frameworks */, 2D91B7A1248EA17C0005B197 /* Resources */, + C86108A8D245915451E09E53 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -184,6 +185,23 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + C86108A8D245915451E09E53 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/Examples/Example-tvOS/Example-tvOS/AppAuthTVExampleViewController.m b/Examples/Example-tvOS/Example-tvOS/AppAuthTVExampleViewController.m index e97b0d204..1cdfb5ccf 100644 --- a/Examples/Example-tvOS/Example-tvOS/AppAuthTVExampleViewController.m +++ b/Examples/Example-tvOS/Example-tvOS/AppAuthTVExampleViewController.m @@ -175,9 +175,8 @@ - (void)performAuthorizationWithConfiguration:(OIDTVServiceConfiguration *)confi [[OIDTVAuthorizationRequest alloc] initWithConfiguration:configuration clientId:kClientID clientSecret:kClientSecret - scopes:@[ OIDScopeOpenID, OIDScopeProfile ] - additionalParameters:nil - additionalHeaders:nil]; + scopes:@[ OIDScopeOpenID, OIDScopeProfile ] + additionalParameters:nil]; OIDTVAuthorizationInitialization initBlock = ^(OIDTVAuthorizationResponse *_Nullable response, NSError *_Nullable error) { diff --git a/Examples/Example-tvOS/Podfile b/Examples/Example-tvOS/Podfile index 979341635..3e7ac1135 100644 --- a/Examples/Example-tvOS/Podfile +++ b/Examples/Example-tvOS/Podfile @@ -1,5 +1,7 @@ platform :tvos, '9.0' +use_frameworks! + target 'Example-tvOS' do # AppAuth Pod, TV subspec # In production, just use `pod 'AppAuth/TV'` without the path reference. diff --git a/Package.swift b/Package.swift index ae72258ac..820e74a6e 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -44,6 +44,7 @@ let package = Package( .target( name: "AppAuthCore", path: "Source/AppAuthCore", + resources: [.copy("../../PrivacyInfo.xcprivacy")], publicHeadersPath: "" ), .target( @@ -51,6 +52,7 @@ let package = Package( dependencies: ["AppAuthCore"], path: "Source/AppAuth", sources: ["iOS", "macOS"], + resources: [.copy("../../PrivacyInfo.xcprivacy")], publicHeadersPath: "", cSettings: [ .headerSearchPath("iOS"), @@ -62,6 +64,7 @@ let package = Package( name: "AppAuthTV", dependencies: ["AppAuthCore"], path: "Source/AppAuthTV", + resources: [.copy("../../PrivacyInfo.xcprivacy")], publicHeadersPath: "" ), .testTarget( diff --git a/PrivacyInfo.xcprivacy b/PrivacyInfo.xcprivacy new file mode 100644 index 000000000..33b390120 --- /dev/null +++ b/PrivacyInfo.xcprivacy @@ -0,0 +1,18 @@ + + + + + NSPrivacyAccessedAPITypes + + + + NSPrivacyCollectedDataTypes + + + + NSPrivacyTrackingDomains + + NSPrivacyTracking + + + From 4625d9d5e084958d2af9bebf7387da72dbf3385f Mon Sep 17 00:00:00 2001 From: mdmathias Date: Fri, 8 Mar 2024 13:02:13 -0800 Subject: [PATCH 06/13] Prepare for 1.7.0 release (#823) --- AppAuth.podspec | 2 +- CHANGELOG.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/AppAuth.podspec b/AppAuth.podspec index 325690783..c9efaffff 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "AppAuth" - s.version = "1.6.2" + s.version = "1.7.0" s.summary = "AppAuth for iOS and macOS is a client SDK for communicating with OAuth 2.0 and OpenID Connect providers." s.description = <<-DESC diff --git a/CHANGELOG.md b/CHANGELOG.md index b682c8a8b..71c7e3bbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 1.7.0 +- Introduce addtional http headers to OIDTokenRequest ([#770](https://github.com/openid/AppAuth-iOS/pull/770)) +- Fix nullability annotation for -[OIDExternalUserAgentIOS init] ([#727](https://github.com/openid/AppAuth-iOS/pull/727)) +- Feat: allow custom nonce in OIDAuthorizationRequest ([#788](https://github.com/openid/AppAuth-iOS/pull/788)) +- Introduce addtional http headers to OIDTokenRequest ([#770](https://github.com/openid/AppAuth-iOS/pull/770)) +- Add privacy manifest ([#822](https://github.com/openid/AppAuth-iOS/pull/822)) + # 1.6.2 - Increased minimum iOS and macOS versions to 9.0 and 10.12 respectively to fix [framework build issue](https://github.com/openid/AppAuth-iOS/issues/765) From 4b6948f8a60b1ea72a179632cfef7ab99dc527db Mon Sep 17 00:00:00 2001 From: mdmathias Date: Fri, 8 Mar 2024 16:08:05 -0800 Subject: [PATCH 07/13] Add back missing method to OIDAuthorizationResponse (#825) --- .../xcschemes/AppAuth-iOS.xcscheme | 22 ++++++++----------- .../xcschemes/AppAuth-tvOS.xcscheme | 22 ++++++++----------- Source/AppAuthCore/OIDAuthorizationResponse.h | 11 ++++++++++ Source/AppAuthCore/OIDAuthorizationResponse.m | 6 +++++ 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuth-iOS.xcscheme b/AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuth-iOS.xcscheme index 5c03fe8e1..d2886e5ea 100644 --- a/AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuth-iOS.xcscheme +++ b/AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuth-iOS.xcscheme @@ -27,6 +27,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - *)additionalParameters; + +/*! @brief Creates a token request suitable for exchanging an authorization code for an access + token. + @param additionalParameters Additional parameters for the token request. + @param additionalHeaders Additional headers for the token request. + @return A @c OIDTokenRequest suitable for exchanging an authorization code for an access + token. + @see https://tools.ietf.org/html/rfc6749#section-4.1.3 + */ - (nullable OIDTokenRequest *)tokenExchangeRequestWithAdditionalParameters: (nullable NSDictionary *)additionalParameters additionalHeaders: diff --git a/Source/AppAuthCore/OIDAuthorizationResponse.m b/Source/AppAuthCore/OIDAuthorizationResponse.m index 5c998a966..957f81d3a 100644 --- a/Source/AppAuthCore/OIDAuthorizationResponse.m +++ b/Source/AppAuthCore/OIDAuthorizationResponse.m @@ -187,6 +187,12 @@ - (OIDTokenRequest *)tokenExchangeRequest { return [self tokenExchangeRequestWithAdditionalParameters:nil additionalHeaders:nil]; } +- (OIDTokenRequest *)tokenExchangeRequestWithAdditionalParameters: + (NSDictionary *)additionalParameters { + return [self tokenExchangeRequestWithAdditionalParameters:additionalParameters + additionalHeaders:nil]; +} + - (OIDTokenRequest *)tokenExchangeRequestWithAdditionalParameters: (NSDictionary *)additionalParameters additionalHeaders: From 2bd00a29745d3baaef75d918b48db045bcdc94d1 Mon Sep 17 00:00:00 2001 From: mdmathias Date: Fri, 8 Mar 2024 17:08:03 -0800 Subject: [PATCH 08/13] Fix OIDTokenRequest for AppAuthCore and AppAuthTV (#826) --- .../xcschemes/AppAuth-macOS.xcscheme | 22 ++++----- Source/AppAuthCore/OIDTokenRequest.h | 49 +++++++++++++++++++ Source/AppAuthCore/OIDTokenRequest.m | 46 +++++++++++++++++ Source/AppAuthTV/OIDTVTokenRequest.h | 14 ++++++ Source/AppAuthTV/OIDTVTokenRequest.m | 13 +++++ 5 files changed, 131 insertions(+), 13 deletions(-) diff --git a/AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuth-macOS.xcscheme b/AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuth-macOS.xcscheme index aa261aca6..74b33a822 100644 --- a/AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuth-macOS.xcscheme +++ b/AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuth-macOS.xcscheme @@ -27,6 +27,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -39,17 +48,6 @@ - - - - - - - - *)scopes + refreshToken:(nullable NSString *)refreshToken + codeVerifier:(nullable NSString *)codeVerifier + additionalParameters:(nullable NSDictionary *)additionalParameters; + +/*! @param configuration The service's configuration. + @param grantType the type of token being sent to the token endpoint, i.e. "authorization_code" + for the authorization code exchange, or "refresh_token" for an access token refresh request. + @see OIDGrantTypes.h + @param code The authorization code received from the authorization server. + @param redirectURL The client's redirect URI. + @param clientID The client identifier. + @param clientSecret The client secret. + @param scope The value of the scope parameter is expressed as a list of space-delimited, + case-sensitive strings. + @param refreshToken The refresh token. + @param codeVerifier The PKCE code verifier. + @param additionalParameters The client's additional token request parameters. + */ +- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration + grantType:(NSString *)grantType + authorizationCode:(nullable NSString *)code + redirectURL:(nullable NSURL *)redirectURL + clientID:(NSString *)clientID + clientSecret:(nullable NSString *)clientSecret + scope:(nullable NSString *)scope + refreshToken:(nullable NSString *)refreshToken + codeVerifier:(nullable NSString *)codeVerifier + additionalParameters:(nullable NSDictionary *)additionalParameters; + /*! @param configuration The service's configuration. @param grantType the type of token being sent to the token endpoint, i.e. "authorization_code" for the authorization code exchange, or "refresh_token" for an access token refresh request. diff --git a/Source/AppAuthCore/OIDTokenRequest.m b/Source/AppAuthCore/OIDTokenRequest.m index e09e5577d..6d30b6d6b 100644 --- a/Source/AppAuthCore/OIDTokenRequest.m +++ b/Source/AppAuthCore/OIDTokenRequest.m @@ -89,6 +89,52 @@ - (instancetype)init additionalHeaders:) ) +- (instancetype)initWithConfiguration:(nonnull OIDServiceConfiguration *)configuration + grantType:(nonnull NSString *)grantType + authorizationCode:(nullable NSString *)code + redirectURL:(nullable NSURL *)redirectURL + clientID:(nonnull NSString *)clientID + clientSecret:(nullable NSString *)clientSecret + scopes:(nullable NSArray *)scopes + refreshToken:(nullable NSString *)refreshToken + codeVerifier:(nullable NSString *)codeVerifier + additionalParameters:(nullable NSDictionary *)additionalParameters { + return [self initWithConfiguration:configuration + grantType:grantType + authorizationCode:code + redirectURL:redirectURL + clientID:clientID + clientSecret:clientSecret + scopes:scopes + refreshToken:refreshToken + codeVerifier:codeVerifier + additionalParameters:additionalParameters + additionalHeaders:_additionalHeaders]; +} + +- (instancetype)initWithConfiguration:(nonnull OIDServiceConfiguration *)configuration + grantType:(nonnull NSString *)grantType + authorizationCode:(nullable NSString *)code + redirectURL:(nullable NSURL *)redirectURL + clientID:(nonnull NSString *)clientID + clientSecret:(nullable NSString *)clientSecret + scope:(nullable NSString *)scope + refreshToken:(nullable NSString *)refreshToken + codeVerifier:(nullable NSString *)codeVerifier + additionalParameters:(nullable NSDictionary *)additionalParameters { + return [self initWithConfiguration:configuration + grantType:grantType + authorizationCode:code + redirectURL:redirectURL + clientID:clientID + clientSecret:clientSecret + scope:scope + refreshToken:refreshToken + codeVerifier:codeVerifier + additionalParameters:additionalParameters + additionalHeaders:_additionalHeaders]; +} + - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration grantType:(NSString *)grantType authorizationCode:(nullable NSString *)code diff --git a/Source/AppAuthTV/OIDTVTokenRequest.h b/Source/AppAuthTV/OIDTVTokenRequest.h index 021dc9b9d..8643b4cc5 100644 --- a/Source/AppAuthTV/OIDTVTokenRequest.h +++ b/Source/AppAuthTV/OIDTVTokenRequest.h @@ -80,6 +80,20 @@ NS_ASSUME_NONNULL_BEGIN (nullable NSDictionary *)additionalHeaders NS_UNAVAILABLE; +/*! @brief Designated initializer. + @param configuration The service's configuration. + @param deviceCode The device verification code received from the authorization server. + @param clientID The client identifier. + @param clientSecret The client secret (nullable). + @param additionalParameters The client's additional token request parameters. +*/ +- (instancetype)initWithConfiguration:(OIDTVServiceConfiguration *)configuration + deviceCode:(NSString *)deviceCode + clientID:(NSString *)clientID + clientSecret:(nullable NSString *)clientSecret + additionalParameters: + (nullable NSDictionary *)additionalParameters; + /*! @brief Designated initializer. @param configuration The service's configuration. @param deviceCode The device verification code received from the authorization server. diff --git a/Source/AppAuthTV/OIDTVTokenRequest.m b/Source/AppAuthTV/OIDTVTokenRequest.m index ed5e4d3f2..0878c7934 100644 --- a/Source/AppAuthTV/OIDTVTokenRequest.m +++ b/Source/AppAuthTV/OIDTVTokenRequest.m @@ -90,6 +90,19 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration additionalHeaders: )) +- (instancetype)initWithConfiguration:(OIDTVServiceConfiguration *)configuration + deviceCode:(NSString *)deviceCode + clientID:(NSString *)clientID + clientSecret:(NSString *)clientSecret + additionalParameters:(NSDictionary *)additionalParameters { + return [self initWithConfiguration:configuration + deviceCode:deviceCode + clientID:clientID + clientSecret:clientSecret + additionalParameters:additionalParameters + additionalHeaders:nil]; +} + - (instancetype)initWithConfiguration:(OIDTVServiceConfiguration *)configuration deviceCode:(NSString *)deviceCode clientID:(NSString *)clientID From 059f77eb1ccf015a6f5b88cb450376dc0707e1b6 Mon Sep 17 00:00:00 2001 From: mdmathias Date: Fri, 8 Mar 2024 17:33:53 -0800 Subject: [PATCH 09/13] Prep for patch release fixing broken API change (#827) --- AppAuth.podspec | 2 +- CHANGELOG.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AppAuth.podspec b/AppAuth.podspec index c9efaffff..5df6b76fe 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "AppAuth" - s.version = "1.7.0" + s.version = "1.7.1" s.summary = "AppAuth for iOS and macOS is a client SDK for communicating with OAuth 2.0 and OpenID Connect providers." s.description = <<-DESC diff --git a/CHANGELOG.md b/CHANGELOG.md index 71c7e3bbc..a2f0e0fca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ +# 1.7.1 +- Add back missing method to OIDAuthorizationResponse ([#825](https://github.com/openid/AppAuth-iOS/pull/825)) +- Fix OIDTokenRequest for AppAuthCore and AppAuthTV ([#826](https://github.com/openid/AppAuth-iOS/pull/826)) + # 1.7.0 - Introduce addtional http headers to OIDTokenRequest ([#770](https://github.com/openid/AppAuth-iOS/pull/770)) - Fix nullability annotation for -[OIDExternalUserAgentIOS init] ([#727](https://github.com/openid/AppAuth-iOS/pull/727)) - Feat: allow custom nonce in OIDAuthorizationRequest ([#788](https://github.com/openid/AppAuth-iOS/pull/788)) -- Introduce addtional http headers to OIDTokenRequest ([#770](https://github.com/openid/AppAuth-iOS/pull/770)) - Add privacy manifest ([#822](https://github.com/openid/AppAuth-iOS/pull/822)) # 1.6.2 From 97b19039d34d07e313fd7f68317c81d501003722 Mon Sep 17 00:00:00 2001 From: mdmathias Date: Mon, 11 Mar 2024 10:46:37 -0700 Subject: [PATCH 10/13] Streamline copying of privacy manifest (#830) --- AppAuth.podspec | 6 ------ PrivacyInfo.xcprivacy | 2 -- 2 files changed, 8 deletions(-) diff --git a/AppAuth.podspec b/AppAuth.podspec index 5df6b76fe..27f2fac3a 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -54,9 +54,6 @@ It follows the OAuth 2.0 for Native Apps best current practice externalUserAgent.dependency 'AppAuth/Core' externalUserAgent.source_files = "Source/AppAuth.h", "Source/AppAuth/*.{h,m}" - externalUserAgent.resource_bundles = { - "AppAuthExternalUserAgent_Privacy" => ["PrivacyInfo.xcprivacy"] - } # iOS externalUserAgent.ios.source_files = "Source/AppAuth/iOS/**/*.{h,m}" @@ -74,9 +71,6 @@ It follows the OAuth 2.0 for Native Apps best current practice s.subspec 'TV' do |tv| tv.source_files = "Source/AppAuthTV.h", "Source/AppAuthTV/*.{h,m}" tv.dependency 'AppAuth/Core' - tv.resource_bundles = { - "AppAuthTV" => ["PrivacyInfo.xcprivacy"] - } end s.default_subspecs = 'Core', 'ExternalUserAgent' diff --git a/PrivacyInfo.xcprivacy b/PrivacyInfo.xcprivacy index 33b390120..cc6746dcb 100644 --- a/PrivacyInfo.xcprivacy +++ b/PrivacyInfo.xcprivacy @@ -4,11 +4,9 @@ NSPrivacyAccessedAPITypes - NSPrivacyCollectedDataTypes - NSPrivacyTrackingDomains From 269c90515328c24f90b2ed17a67c8a796b485448 Mon Sep 17 00:00:00 2001 From: mdmathias Date: Mon, 11 Mar 2024 11:16:35 -0700 Subject: [PATCH 11/13] Prep patch release fixing errors in privacy reports (#831) --- AppAuth.podspec | 2 +- CHANGELOG.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AppAuth.podspec b/AppAuth.podspec index 27f2fac3a..a328e6be5 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "AppAuth" - s.version = "1.7.1" + s.version = "1.7.2" s.summary = "AppAuth for iOS and macOS is a client SDK for communicating with OAuth 2.0 and OpenID Connect providers." s.description = <<-DESC diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f0e0fca..12e915e1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.7.2 + - Streamline copying of privacy manifest ([#830](https://github.com/openid/AppAuth-iOS/pull/830)) + # 1.7.1 - Add back missing method to OIDAuthorizationResponse ([#825](https://github.com/openid/AppAuth-iOS/pull/825)) - Fix OIDTokenRequest for AppAuthCore and AppAuthTV ([#826](https://github.com/openid/AppAuth-iOS/pull/826)) From 5563d068aac2bbcadd081a1e26e9cf0dbe8af8ba Mon Sep 17 00:00:00 2001 From: mdmathias Date: Wed, 13 Mar 2024 13:26:42 -0700 Subject: [PATCH 12/13] Fix missing manifest in bundle using SPM (#833) --- AppAuth.podspec | 12 ++-- AppAuth.xcodeproj/project.pbxproj | 56 +++++++++++++------ Package.swift | 12 ++-- {Source => Sources}/AppAuth.h | 0 .../AppAuth/Resources/PrivacyInfo.xcprivacy | 0 .../AppAuth/iOS/OIDAuthState+IOS.h | 0 .../AppAuth/iOS/OIDAuthState+IOS.m | 0 .../AppAuth/iOS/OIDAuthorizationService+IOS.h | 0 .../AppAuth/iOS/OIDAuthorizationService+IOS.m | 0 .../iOS/OIDExternalUserAgentCatalyst.h | 0 .../iOS/OIDExternalUserAgentCatalyst.m | 0 .../AppAuth/iOS/OIDExternalUserAgentIOS.h | 0 .../AppAuth/iOS/OIDExternalUserAgentIOS.m | 0 .../OIDExternalUserAgentIOSCustomBrowser.h | 0 .../OIDExternalUserAgentIOSCustomBrowser.m | 0 .../OIDLoopbackHTTPServer.h | 0 .../OIDLoopbackHTTPServer.m | 0 .../AppAuth/macOS/OIDAuthState+Mac.h | 0 .../AppAuth/macOS/OIDAuthState+Mac.m | 0 .../macOS/OIDAuthorizationService+Mac.h | 0 .../macOS/OIDAuthorizationService+Mac.m | 0 .../AppAuth/macOS/OIDExternalUserAgentMac.h | 0 .../AppAuth/macOS/OIDExternalUserAgentMac.m | 0 .../AppAuth/macOS/OIDRedirectHTTPHandler.h | 0 .../AppAuth/macOS/OIDRedirectHTTPHandler.m | 0 {Source => Sources}/AppAuthCore.h | 0 .../AppAuthCore/OIDAuthState.h | 0 .../AppAuthCore/OIDAuthState.m | 0 .../AppAuthCore/OIDAuthStateChangeDelegate.h | 0 .../AppAuthCore/OIDAuthStateErrorDelegate.h | 0 .../AppAuthCore/OIDAuthorizationRequest.h | 0 .../AppAuthCore/OIDAuthorizationRequest.m | 0 .../AppAuthCore/OIDAuthorizationResponse.h | 0 .../AppAuthCore/OIDAuthorizationResponse.m | 0 .../AppAuthCore/OIDAuthorizationService.h | 0 .../AppAuthCore/OIDAuthorizationService.m | 0 .../AppAuthCore/OIDClientMetadataParameters.h | 0 .../AppAuthCore/OIDClientMetadataParameters.m | 0 {Source => Sources}/AppAuthCore/OIDDefines.h | 0 .../AppAuthCore/OIDEndSessionRequest.h | 0 .../AppAuthCore/OIDEndSessionRequest.m | 0 .../AppAuthCore/OIDEndSessionResponse.h | 0 .../AppAuthCore/OIDEndSessionResponse.m | 0 {Source => Sources}/AppAuthCore/OIDError.h | 0 {Source => Sources}/AppAuthCore/OIDError.m | 0 .../AppAuthCore/OIDErrorUtilities.h | 0 .../AppAuthCore/OIDErrorUtilities.m | 0 .../AppAuthCore/OIDExternalUserAgent.h | 0 .../AppAuthCore/OIDExternalUserAgentRequest.h | 0 .../AppAuthCore/OIDExternalUserAgentSession.h | 0 .../AppAuthCore/OIDFieldMapping.h | 0 .../AppAuthCore/OIDFieldMapping.m | 0 .../AppAuthCore/OIDGrantTypes.h | 0 .../AppAuthCore/OIDGrantTypes.m | 0 {Source => Sources}/AppAuthCore/OIDIDToken.h | 0 {Source => Sources}/AppAuthCore/OIDIDToken.m | 0 .../AppAuthCore/OIDRegistrationRequest.h | 0 .../AppAuthCore/OIDRegistrationRequest.m | 0 .../AppAuthCore/OIDRegistrationResponse.h | 0 .../AppAuthCore/OIDRegistrationResponse.m | 0 .../AppAuthCore/OIDResponseTypes.h | 0 .../AppAuthCore/OIDResponseTypes.m | 0 .../AppAuthCore/OIDScopeUtilities.h | 0 .../AppAuthCore/OIDScopeUtilities.m | 0 {Source => Sources}/AppAuthCore/OIDScopes.h | 0 {Source => Sources}/AppAuthCore/OIDScopes.m | 0 .../AppAuthCore/OIDServiceConfiguration.h | 0 .../AppAuthCore/OIDServiceConfiguration.m | 0 .../AppAuthCore/OIDServiceDiscovery.h | 0 .../AppAuthCore/OIDServiceDiscovery.m | 0 .../AppAuthCore/OIDTokenRequest.h | 0 .../AppAuthCore/OIDTokenRequest.m | 0 .../AppAuthCore/OIDTokenResponse.h | 0 .../AppAuthCore/OIDTokenResponse.m | 0 .../AppAuthCore/OIDTokenUtilities.h | 0 .../AppAuthCore/OIDTokenUtilities.m | 0 .../AppAuthCore/OIDURLQueryComponent.h | 0 .../AppAuthCore/OIDURLQueryComponent.m | 0 .../AppAuthCore/OIDURLSessionProvider.h | 0 .../AppAuthCore/OIDURLSessionProvider.m | 0 .../Resources/PrivacyInfo.xcprivacy | 16 ++++++ {Source => Sources}/AppAuthTV.h | 0 .../AppAuthTV/OIDTVAuthorizationRequest.h | 0 .../AppAuthTV/OIDTVAuthorizationRequest.m | 0 .../AppAuthTV/OIDTVAuthorizationResponse.h | 0 .../AppAuthTV/OIDTVAuthorizationResponse.m | 0 .../AppAuthTV/OIDTVAuthorizationService.h | 0 .../AppAuthTV/OIDTVAuthorizationService.m | 0 .../AppAuthTV/OIDTVServiceConfiguration.h | 0 .../AppAuthTV/OIDTVServiceConfiguration.m | 0 .../AppAuthTV/OIDTVTokenRequest.h | 0 .../AppAuthTV/OIDTVTokenRequest.m | 0 .../AppAuthTV/Resources/PrivacyInfo.xcprivacy | 16 ++++++ .../CoreFramework/AppAuthCore.h | 0 {Source => Sources}/CoreFramework/Info.plist | 0 {Source => Sources}/Framework/AppAuth.h | 0 {Source => Sources}/Framework/Info.plist | 0 {Source => Sources}/TVFramework/AppAuthTV.h | 0 {Source => Sources}/TVFramework/Info.plist | 0 .../OIDTVAuthorizationRequestTests.m | 8 +-- .../OIDTVAuthorizationResponseTests.m | 12 ++-- UnitTests/AppAuthTV/OIDTVTokenRequestTests.m | 10 ++-- UnitTests/OIDAuthStateTests.h | 4 +- UnitTests/OIDAuthStateTests.m | 10 ++-- UnitTests/OIDAuthorizationRequestTests.m | 6 +- UnitTests/OIDAuthorizationResponseTests.m | 6 +- UnitTests/OIDEndSessionRequestTests.m | 6 +- UnitTests/OIDGrantTypesTests.m | 2 +- UnitTests/OIDRegistrationRequestTests.m | 6 +- UnitTests/OIDRegistrationResponseTests.m | 4 +- UnitTests/OIDResponseTypesTests.m | 2 +- UnitTests/OIDScopesTests.m | 2 +- UnitTests/OIDServiceConfigurationTests.m | 8 +-- UnitTests/OIDServiceDiscoveryTests.m | 4 +- UnitTests/OIDTokenRequestTests.m | 10 ++-- UnitTests/OIDTokenResponseTests.m | 4 +- UnitTests/OIDTokenUtilitiesTests.m | 2 +- UnitTests/OIDURLQueryComponentTests.m | 2 +- UnitTests/OIDURLQueryComponentTestsIOS7.m | 2 +- 119 files changed, 139 insertions(+), 83 deletions(-) rename {Source => Sources}/AppAuth.h (100%) rename PrivacyInfo.xcprivacy => Sources/AppAuth/Resources/PrivacyInfo.xcprivacy (100%) rename {Source => Sources}/AppAuth/iOS/OIDAuthState+IOS.h (100%) rename {Source => Sources}/AppAuth/iOS/OIDAuthState+IOS.m (100%) rename {Source => Sources}/AppAuth/iOS/OIDAuthorizationService+IOS.h (100%) rename {Source => Sources}/AppAuth/iOS/OIDAuthorizationService+IOS.m (100%) rename {Source => Sources}/AppAuth/iOS/OIDExternalUserAgentCatalyst.h (100%) rename {Source => Sources}/AppAuth/iOS/OIDExternalUserAgentCatalyst.m (100%) rename {Source => Sources}/AppAuth/iOS/OIDExternalUserAgentIOS.h (100%) rename {Source => Sources}/AppAuth/iOS/OIDExternalUserAgentIOS.m (100%) rename {Source => Sources}/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.h (100%) rename {Source => Sources}/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m (100%) rename {Source => Sources}/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.h (100%) rename {Source => Sources}/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.m (100%) rename {Source => Sources}/AppAuth/macOS/OIDAuthState+Mac.h (100%) rename {Source => Sources}/AppAuth/macOS/OIDAuthState+Mac.m (100%) rename {Source => Sources}/AppAuth/macOS/OIDAuthorizationService+Mac.h (100%) rename {Source => Sources}/AppAuth/macOS/OIDAuthorizationService+Mac.m (100%) rename {Source => Sources}/AppAuth/macOS/OIDExternalUserAgentMac.h (100%) rename {Source => Sources}/AppAuth/macOS/OIDExternalUserAgentMac.m (100%) rename {Source => Sources}/AppAuth/macOS/OIDRedirectHTTPHandler.h (100%) rename {Source => Sources}/AppAuth/macOS/OIDRedirectHTTPHandler.m (100%) rename {Source => Sources}/AppAuthCore.h (100%) rename {Source => Sources}/AppAuthCore/OIDAuthState.h (100%) rename {Source => Sources}/AppAuthCore/OIDAuthState.m (100%) rename {Source => Sources}/AppAuthCore/OIDAuthStateChangeDelegate.h (100%) rename {Source => Sources}/AppAuthCore/OIDAuthStateErrorDelegate.h (100%) rename {Source => Sources}/AppAuthCore/OIDAuthorizationRequest.h (100%) rename {Source => Sources}/AppAuthCore/OIDAuthorizationRequest.m (100%) rename {Source => Sources}/AppAuthCore/OIDAuthorizationResponse.h (100%) rename {Source => Sources}/AppAuthCore/OIDAuthorizationResponse.m (100%) rename {Source => Sources}/AppAuthCore/OIDAuthorizationService.h (100%) rename {Source => Sources}/AppAuthCore/OIDAuthorizationService.m (100%) rename {Source => Sources}/AppAuthCore/OIDClientMetadataParameters.h (100%) rename {Source => Sources}/AppAuthCore/OIDClientMetadataParameters.m (100%) rename {Source => Sources}/AppAuthCore/OIDDefines.h (100%) rename {Source => Sources}/AppAuthCore/OIDEndSessionRequest.h (100%) rename {Source => Sources}/AppAuthCore/OIDEndSessionRequest.m (100%) rename {Source => Sources}/AppAuthCore/OIDEndSessionResponse.h (100%) rename {Source => Sources}/AppAuthCore/OIDEndSessionResponse.m (100%) rename {Source => Sources}/AppAuthCore/OIDError.h (100%) rename {Source => Sources}/AppAuthCore/OIDError.m (100%) rename {Source => Sources}/AppAuthCore/OIDErrorUtilities.h (100%) rename {Source => Sources}/AppAuthCore/OIDErrorUtilities.m (100%) rename {Source => Sources}/AppAuthCore/OIDExternalUserAgent.h (100%) rename {Source => Sources}/AppAuthCore/OIDExternalUserAgentRequest.h (100%) rename {Source => Sources}/AppAuthCore/OIDExternalUserAgentSession.h (100%) rename {Source => Sources}/AppAuthCore/OIDFieldMapping.h (100%) rename {Source => Sources}/AppAuthCore/OIDFieldMapping.m (100%) rename {Source => Sources}/AppAuthCore/OIDGrantTypes.h (100%) rename {Source => Sources}/AppAuthCore/OIDGrantTypes.m (100%) rename {Source => Sources}/AppAuthCore/OIDIDToken.h (100%) rename {Source => Sources}/AppAuthCore/OIDIDToken.m (100%) rename {Source => Sources}/AppAuthCore/OIDRegistrationRequest.h (100%) rename {Source => Sources}/AppAuthCore/OIDRegistrationRequest.m (100%) rename {Source => Sources}/AppAuthCore/OIDRegistrationResponse.h (100%) rename {Source => Sources}/AppAuthCore/OIDRegistrationResponse.m (100%) rename {Source => Sources}/AppAuthCore/OIDResponseTypes.h (100%) rename {Source => Sources}/AppAuthCore/OIDResponseTypes.m (100%) rename {Source => Sources}/AppAuthCore/OIDScopeUtilities.h (100%) rename {Source => Sources}/AppAuthCore/OIDScopeUtilities.m (100%) rename {Source => Sources}/AppAuthCore/OIDScopes.h (100%) rename {Source => Sources}/AppAuthCore/OIDScopes.m (100%) rename {Source => Sources}/AppAuthCore/OIDServiceConfiguration.h (100%) rename {Source => Sources}/AppAuthCore/OIDServiceConfiguration.m (100%) rename {Source => Sources}/AppAuthCore/OIDServiceDiscovery.h (100%) rename {Source => Sources}/AppAuthCore/OIDServiceDiscovery.m (100%) rename {Source => Sources}/AppAuthCore/OIDTokenRequest.h (100%) rename {Source => Sources}/AppAuthCore/OIDTokenRequest.m (100%) rename {Source => Sources}/AppAuthCore/OIDTokenResponse.h (100%) rename {Source => Sources}/AppAuthCore/OIDTokenResponse.m (100%) rename {Source => Sources}/AppAuthCore/OIDTokenUtilities.h (100%) rename {Source => Sources}/AppAuthCore/OIDTokenUtilities.m (100%) rename {Source => Sources}/AppAuthCore/OIDURLQueryComponent.h (100%) rename {Source => Sources}/AppAuthCore/OIDURLQueryComponent.m (100%) rename {Source => Sources}/AppAuthCore/OIDURLSessionProvider.h (100%) rename {Source => Sources}/AppAuthCore/OIDURLSessionProvider.m (100%) create mode 100644 Sources/AppAuthCore/Resources/PrivacyInfo.xcprivacy rename {Source => Sources}/AppAuthTV.h (100%) rename {Source => Sources}/AppAuthTV/OIDTVAuthorizationRequest.h (100%) rename {Source => Sources}/AppAuthTV/OIDTVAuthorizationRequest.m (100%) rename {Source => Sources}/AppAuthTV/OIDTVAuthorizationResponse.h (100%) rename {Source => Sources}/AppAuthTV/OIDTVAuthorizationResponse.m (100%) rename {Source => Sources}/AppAuthTV/OIDTVAuthorizationService.h (100%) rename {Source => Sources}/AppAuthTV/OIDTVAuthorizationService.m (100%) rename {Source => Sources}/AppAuthTV/OIDTVServiceConfiguration.h (100%) rename {Source => Sources}/AppAuthTV/OIDTVServiceConfiguration.m (100%) rename {Source => Sources}/AppAuthTV/OIDTVTokenRequest.h (100%) rename {Source => Sources}/AppAuthTV/OIDTVTokenRequest.m (100%) create mode 100644 Sources/AppAuthTV/Resources/PrivacyInfo.xcprivacy rename {Source => Sources}/CoreFramework/AppAuthCore.h (100%) rename {Source => Sources}/CoreFramework/Info.plist (100%) rename {Source => Sources}/Framework/AppAuth.h (100%) rename {Source => Sources}/Framework/Info.plist (100%) rename {Source => Sources}/TVFramework/AppAuthTV.h (100%) rename {Source => Sources}/TVFramework/Info.plist (100%) diff --git a/AppAuth.podspec b/AppAuth.podspec index a328e6be5..70f3e4168 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -43,9 +43,9 @@ It follows the OAuth 2.0 for Native Apps best current practice # Subspec for the core AppAuth library classes only, suitable for extensions. s.subspec 'Core' do |core| - core.source_files = "Source/AppAuthCore.h", "Source/AppAuthCore/*.{h,m}" + core.source_files = "Sources/AppAuthCore.h", "Sources/AppAuthCore/*.{h,m}" core.resource_bundles = { - "AppAuthCore_Privacy" => ["PrivacyInfo.xcprivacy"] + "AppAuthCore_Privacy" => ["Sources/AppAuthCore/Resources/PrivacyInfo.xcprivacy"] } end @@ -53,23 +53,23 @@ It follows the OAuth 2.0 for Native Apps best current practice s.subspec 'ExternalUserAgent' do |externalUserAgent| externalUserAgent.dependency 'AppAuth/Core' - externalUserAgent.source_files = "Source/AppAuth.h", "Source/AppAuth/*.{h,m}" + externalUserAgent.source_files = "Sources/AppAuth.h", "Sources/AppAuth/*.{h,m}" # iOS - externalUserAgent.ios.source_files = "Source/AppAuth/iOS/**/*.{h,m}" + externalUserAgent.ios.source_files = "Sources/AppAuth/iOS/**/*.{h,m}" externalUserAgent.ios.deployment_target = ios_deployment_target externalUserAgent.ios.frameworks = "SafariServices" externalUserAgent.ios.weak_frameworks = "AuthenticationServices" # macOS - externalUserAgent.osx.source_files = "Source/AppAuth/macOS/**/*.{h,m}" + externalUserAgent.osx.source_files = "Sources/AppAuth/macOS/**/*.{h,m}" externalUserAgent.osx.deployment_target = osx_deployment_target externalUserAgent.osx.weak_frameworks = "AuthenticationServices" end # Subspec for the full AppAuth library, including platform-dependent external user agents. s.subspec 'TV' do |tv| - tv.source_files = "Source/AppAuthTV.h", "Source/AppAuthTV/*.{h,m}" + tv.source_files = "Sources/AppAuthTV.h", "Sources/AppAuthTV/*.{h,m}" tv.dependency 'AppAuth/Core' end diff --git a/AppAuth.xcodeproj/project.pbxproj b/AppAuth.xcodeproj/project.pbxproj index 1f4a2a876..8d770d93c 100644 --- a/AppAuth.xcodeproj/project.pbxproj +++ b/AppAuth.xcodeproj/project.pbxproj @@ -1000,6 +1000,7 @@ 2D47AAD7249A86E30059B5A4 /* AppAuthTV */ = { isa = PBXGroup; children = ( + 7322C49B2BA20BFA00DF9B2F /* Resources */, 2D47AAD9249A87010059B5A4 /* OIDTVAuthorizationRequest.h */, 2D47AADD249A87010059B5A4 /* OIDTVAuthorizationRequest.m */, 2D47AADC249A87010059B5A4 /* OIDTVAuthorizationResponse.h */, @@ -1055,10 +1056,9 @@ 340E73731C5D819B0076B1F6 = { isa = PBXGroup; children = ( - 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */, 341742291C5D84D0000EF209 /* Frameworks */, 341741FB1C5D82D3000EF209 /* UnitTests */, - 341741AE1C5D8243000EF209 /* Source */, + 341741AE1C5D8243000EF209 /* Sources */, 340E737D1C5D819B0076B1F6 /* Products */, ); indentWidth = 2; @@ -1090,7 +1090,7 @@ name = Products; sourceTree = ""; }; - 341741AE1C5D8243000EF209 /* Source */ = { + 341741AE1C5D8243000EF209 /* Sources */ = { isa = PBXGroup; children = ( 348970992178F40600ABEED4 /* CoreFramework */, @@ -1103,7 +1103,7 @@ 3489709E21791B0C00ABEED4 /* AppAuthCore.h */, 2D47AADB249A87010059B5A4 /* AppAuthTV.h */, ); - path = Source; + path = Sources; sourceTree = ""; }; 341741FB1C5D82D3000EF209 /* UnitTests */ = { @@ -1184,9 +1184,32 @@ path = LoopbackHTTPServer; sourceTree = ""; }; + 7322C4992BA2095100DF9B2F /* Resources */ = { + isa = PBXGroup; + children = ( + 73F574332B7C42690023FFF0 /* PrivacyInfo.xcprivacy */, + ); + path = Resources; + sourceTree = ""; + }; + 7322C49A2BA20BEF00DF9B2F /* Resources */ = { + isa = PBXGroup; + children = ( + ); + path = Resources; + sourceTree = ""; + }; + 7322C49B2BA20BFA00DF9B2F /* Resources */ = { + isa = PBXGroup; + children = ( + ); + path = Resources; + sourceTree = ""; + }; 8A9B9D5E24561EC40055353E /* AppAuthCore */ = { isa = PBXGroup; children = ( + 7322C4992BA2095100DF9B2F /* Resources */, 341741B41C5D8243000EF209 /* OIDAuthorizationRequest.h */, 341741B51C5D8243000EF209 /* OIDAuthorizationRequest.m */, 341741B61C5D8243000EF209 /* OIDAuthorizationResponse.h */, @@ -1248,6 +1271,7 @@ 8A9B9D632456227D0055353E /* AppAuth */ = { isa = PBXGroup; children = ( + 7322C49A2BA20BEF00DF9B2F /* Resources */, 340DAE241D581FE700EC285B /* macOS */, F6F60FAF1D2BFEF000325CB3 /* iOS */, ); @@ -2668,7 +2692,7 @@ "DEBUG=1", "$(inherited)", ); - INFOPLIST_FILE = "$(SRCROOT)/Source/TVFramework/Info.plist"; + INFOPLIST_FILE = Sources/TVFramework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -2700,7 +2724,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; - INFOPLIST_FILE = "$(SRCROOT)/Source/TVFramework/Info.plist"; + INFOPLIST_FILE = Sources/TVFramework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_FAST_MATH = YES; @@ -3012,7 +3036,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/CoreFramework/Info.plist; + INFOPLIST_FILE = Sources/CoreFramework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -3038,7 +3062,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/CoreFramework/Info.plist; + INFOPLIST_FILE = Sources/CoreFramework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -3063,7 +3087,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/Framework/Info.plist; + INFOPLIST_FILE = Sources/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -3088,7 +3112,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/Framework/Info.plist; + INFOPLIST_FILE = Sources/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -3142,7 +3166,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/Framework/Info.plist; + INFOPLIST_FILE = Sources/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.AppAuth-watchOS"; @@ -3168,7 +3192,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/Framework/Info.plist; + INFOPLIST_FILE = Sources/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.AppAuth-watchOS"; @@ -3193,7 +3217,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/Framework/Info.plist; + INFOPLIST_FILE = Sources/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.AppAuth-tvOS"; @@ -3218,7 +3242,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/Framework/Info.plist; + INFOPLIST_FILE = Sources/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.AppAuth-tvOS"; @@ -3275,7 +3299,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = Source/Framework/Info.plist; + INFOPLIST_FILE = Sources/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.AppAuth-macOS"; @@ -3300,7 +3324,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = Source/Framework/Info.plist; + INFOPLIST_FILE = Sources/Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.openid.AppAuth-macOS"; diff --git a/Package.swift b/Package.swift index 820e74a6e..103c0f761 100644 --- a/Package.swift +++ b/Package.swift @@ -43,16 +43,16 @@ let package = Package( targets: [ .target( name: "AppAuthCore", - path: "Source/AppAuthCore", - resources: [.copy("../../PrivacyInfo.xcprivacy")], + path: "Sources/AppAuthCore", + resources: [.copy("Resources/PrivacyInfo.xcprivacy")], publicHeadersPath: "" ), .target( name: "AppAuth", dependencies: ["AppAuthCore"], - path: "Source/AppAuth", + path: "Sources/AppAuth", sources: ["iOS", "macOS"], - resources: [.copy("../../PrivacyInfo.xcprivacy")], + resources: [.copy("Resources/PrivacyInfo.xcprivacy")], publicHeadersPath: "", cSettings: [ .headerSearchPath("iOS"), @@ -63,8 +63,8 @@ let package = Package( .target( name: "AppAuthTV", dependencies: ["AppAuthCore"], - path: "Source/AppAuthTV", - resources: [.copy("../../PrivacyInfo.xcprivacy")], + path: "Sources/AppAuthTV", + resources: [.copy("Resources/PrivacyInfo.xcprivacy")], publicHeadersPath: "" ), .testTarget( diff --git a/Source/AppAuth.h b/Sources/AppAuth.h similarity index 100% rename from Source/AppAuth.h rename to Sources/AppAuth.h diff --git a/PrivacyInfo.xcprivacy b/Sources/AppAuth/Resources/PrivacyInfo.xcprivacy similarity index 100% rename from PrivacyInfo.xcprivacy rename to Sources/AppAuth/Resources/PrivacyInfo.xcprivacy diff --git a/Source/AppAuth/iOS/OIDAuthState+IOS.h b/Sources/AppAuth/iOS/OIDAuthState+IOS.h similarity index 100% rename from Source/AppAuth/iOS/OIDAuthState+IOS.h rename to Sources/AppAuth/iOS/OIDAuthState+IOS.h diff --git a/Source/AppAuth/iOS/OIDAuthState+IOS.m b/Sources/AppAuth/iOS/OIDAuthState+IOS.m similarity index 100% rename from Source/AppAuth/iOS/OIDAuthState+IOS.m rename to Sources/AppAuth/iOS/OIDAuthState+IOS.m diff --git a/Source/AppAuth/iOS/OIDAuthorizationService+IOS.h b/Sources/AppAuth/iOS/OIDAuthorizationService+IOS.h similarity index 100% rename from Source/AppAuth/iOS/OIDAuthorizationService+IOS.h rename to Sources/AppAuth/iOS/OIDAuthorizationService+IOS.h diff --git a/Source/AppAuth/iOS/OIDAuthorizationService+IOS.m b/Sources/AppAuth/iOS/OIDAuthorizationService+IOS.m similarity index 100% rename from Source/AppAuth/iOS/OIDAuthorizationService+IOS.m rename to Sources/AppAuth/iOS/OIDAuthorizationService+IOS.m diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentCatalyst.h b/Sources/AppAuth/iOS/OIDExternalUserAgentCatalyst.h similarity index 100% rename from Source/AppAuth/iOS/OIDExternalUserAgentCatalyst.h rename to Sources/AppAuth/iOS/OIDExternalUserAgentCatalyst.h diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentCatalyst.m b/Sources/AppAuth/iOS/OIDExternalUserAgentCatalyst.m similarity index 100% rename from Source/AppAuth/iOS/OIDExternalUserAgentCatalyst.m rename to Sources/AppAuth/iOS/OIDExternalUserAgentCatalyst.m diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h b/Sources/AppAuth/iOS/OIDExternalUserAgentIOS.h similarity index 100% rename from Source/AppAuth/iOS/OIDExternalUserAgentIOS.h rename to Sources/AppAuth/iOS/OIDExternalUserAgentIOS.h diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m b/Sources/AppAuth/iOS/OIDExternalUserAgentIOS.m similarity index 100% rename from Source/AppAuth/iOS/OIDExternalUserAgentIOS.m rename to Sources/AppAuth/iOS/OIDExternalUserAgentIOS.m diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.h b/Sources/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.h similarity index 100% rename from Source/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.h rename to Sources/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.h diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m b/Sources/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m similarity index 100% rename from Source/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m rename to Sources/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m diff --git a/Source/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.h b/Sources/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.h similarity index 100% rename from Source/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.h rename to Sources/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.h diff --git a/Source/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.m b/Sources/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.m similarity index 100% rename from Source/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.m rename to Sources/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.m diff --git a/Source/AppAuth/macOS/OIDAuthState+Mac.h b/Sources/AppAuth/macOS/OIDAuthState+Mac.h similarity index 100% rename from Source/AppAuth/macOS/OIDAuthState+Mac.h rename to Sources/AppAuth/macOS/OIDAuthState+Mac.h diff --git a/Source/AppAuth/macOS/OIDAuthState+Mac.m b/Sources/AppAuth/macOS/OIDAuthState+Mac.m similarity index 100% rename from Source/AppAuth/macOS/OIDAuthState+Mac.m rename to Sources/AppAuth/macOS/OIDAuthState+Mac.m diff --git a/Source/AppAuth/macOS/OIDAuthorizationService+Mac.h b/Sources/AppAuth/macOS/OIDAuthorizationService+Mac.h similarity index 100% rename from Source/AppAuth/macOS/OIDAuthorizationService+Mac.h rename to Sources/AppAuth/macOS/OIDAuthorizationService+Mac.h diff --git a/Source/AppAuth/macOS/OIDAuthorizationService+Mac.m b/Sources/AppAuth/macOS/OIDAuthorizationService+Mac.m similarity index 100% rename from Source/AppAuth/macOS/OIDAuthorizationService+Mac.m rename to Sources/AppAuth/macOS/OIDAuthorizationService+Mac.m diff --git a/Source/AppAuth/macOS/OIDExternalUserAgentMac.h b/Sources/AppAuth/macOS/OIDExternalUserAgentMac.h similarity index 100% rename from Source/AppAuth/macOS/OIDExternalUserAgentMac.h rename to Sources/AppAuth/macOS/OIDExternalUserAgentMac.h diff --git a/Source/AppAuth/macOS/OIDExternalUserAgentMac.m b/Sources/AppAuth/macOS/OIDExternalUserAgentMac.m similarity index 100% rename from Source/AppAuth/macOS/OIDExternalUserAgentMac.m rename to Sources/AppAuth/macOS/OIDExternalUserAgentMac.m diff --git a/Source/AppAuth/macOS/OIDRedirectHTTPHandler.h b/Sources/AppAuth/macOS/OIDRedirectHTTPHandler.h similarity index 100% rename from Source/AppAuth/macOS/OIDRedirectHTTPHandler.h rename to Sources/AppAuth/macOS/OIDRedirectHTTPHandler.h diff --git a/Source/AppAuth/macOS/OIDRedirectHTTPHandler.m b/Sources/AppAuth/macOS/OIDRedirectHTTPHandler.m similarity index 100% rename from Source/AppAuth/macOS/OIDRedirectHTTPHandler.m rename to Sources/AppAuth/macOS/OIDRedirectHTTPHandler.m diff --git a/Source/AppAuthCore.h b/Sources/AppAuthCore.h similarity index 100% rename from Source/AppAuthCore.h rename to Sources/AppAuthCore.h diff --git a/Source/AppAuthCore/OIDAuthState.h b/Sources/AppAuthCore/OIDAuthState.h similarity index 100% rename from Source/AppAuthCore/OIDAuthState.h rename to Sources/AppAuthCore/OIDAuthState.h diff --git a/Source/AppAuthCore/OIDAuthState.m b/Sources/AppAuthCore/OIDAuthState.m similarity index 100% rename from Source/AppAuthCore/OIDAuthState.m rename to Sources/AppAuthCore/OIDAuthState.m diff --git a/Source/AppAuthCore/OIDAuthStateChangeDelegate.h b/Sources/AppAuthCore/OIDAuthStateChangeDelegate.h similarity index 100% rename from Source/AppAuthCore/OIDAuthStateChangeDelegate.h rename to Sources/AppAuthCore/OIDAuthStateChangeDelegate.h diff --git a/Source/AppAuthCore/OIDAuthStateErrorDelegate.h b/Sources/AppAuthCore/OIDAuthStateErrorDelegate.h similarity index 100% rename from Source/AppAuthCore/OIDAuthStateErrorDelegate.h rename to Sources/AppAuthCore/OIDAuthStateErrorDelegate.h diff --git a/Source/AppAuthCore/OIDAuthorizationRequest.h b/Sources/AppAuthCore/OIDAuthorizationRequest.h similarity index 100% rename from Source/AppAuthCore/OIDAuthorizationRequest.h rename to Sources/AppAuthCore/OIDAuthorizationRequest.h diff --git a/Source/AppAuthCore/OIDAuthorizationRequest.m b/Sources/AppAuthCore/OIDAuthorizationRequest.m similarity index 100% rename from Source/AppAuthCore/OIDAuthorizationRequest.m rename to Sources/AppAuthCore/OIDAuthorizationRequest.m diff --git a/Source/AppAuthCore/OIDAuthorizationResponse.h b/Sources/AppAuthCore/OIDAuthorizationResponse.h similarity index 100% rename from Source/AppAuthCore/OIDAuthorizationResponse.h rename to Sources/AppAuthCore/OIDAuthorizationResponse.h diff --git a/Source/AppAuthCore/OIDAuthorizationResponse.m b/Sources/AppAuthCore/OIDAuthorizationResponse.m similarity index 100% rename from Source/AppAuthCore/OIDAuthorizationResponse.m rename to Sources/AppAuthCore/OIDAuthorizationResponse.m diff --git a/Source/AppAuthCore/OIDAuthorizationService.h b/Sources/AppAuthCore/OIDAuthorizationService.h similarity index 100% rename from Source/AppAuthCore/OIDAuthorizationService.h rename to Sources/AppAuthCore/OIDAuthorizationService.h diff --git a/Source/AppAuthCore/OIDAuthorizationService.m b/Sources/AppAuthCore/OIDAuthorizationService.m similarity index 100% rename from Source/AppAuthCore/OIDAuthorizationService.m rename to Sources/AppAuthCore/OIDAuthorizationService.m diff --git a/Source/AppAuthCore/OIDClientMetadataParameters.h b/Sources/AppAuthCore/OIDClientMetadataParameters.h similarity index 100% rename from Source/AppAuthCore/OIDClientMetadataParameters.h rename to Sources/AppAuthCore/OIDClientMetadataParameters.h diff --git a/Source/AppAuthCore/OIDClientMetadataParameters.m b/Sources/AppAuthCore/OIDClientMetadataParameters.m similarity index 100% rename from Source/AppAuthCore/OIDClientMetadataParameters.m rename to Sources/AppAuthCore/OIDClientMetadataParameters.m diff --git a/Source/AppAuthCore/OIDDefines.h b/Sources/AppAuthCore/OIDDefines.h similarity index 100% rename from Source/AppAuthCore/OIDDefines.h rename to Sources/AppAuthCore/OIDDefines.h diff --git a/Source/AppAuthCore/OIDEndSessionRequest.h b/Sources/AppAuthCore/OIDEndSessionRequest.h similarity index 100% rename from Source/AppAuthCore/OIDEndSessionRequest.h rename to Sources/AppAuthCore/OIDEndSessionRequest.h diff --git a/Source/AppAuthCore/OIDEndSessionRequest.m b/Sources/AppAuthCore/OIDEndSessionRequest.m similarity index 100% rename from Source/AppAuthCore/OIDEndSessionRequest.m rename to Sources/AppAuthCore/OIDEndSessionRequest.m diff --git a/Source/AppAuthCore/OIDEndSessionResponse.h b/Sources/AppAuthCore/OIDEndSessionResponse.h similarity index 100% rename from Source/AppAuthCore/OIDEndSessionResponse.h rename to Sources/AppAuthCore/OIDEndSessionResponse.h diff --git a/Source/AppAuthCore/OIDEndSessionResponse.m b/Sources/AppAuthCore/OIDEndSessionResponse.m similarity index 100% rename from Source/AppAuthCore/OIDEndSessionResponse.m rename to Sources/AppAuthCore/OIDEndSessionResponse.m diff --git a/Source/AppAuthCore/OIDError.h b/Sources/AppAuthCore/OIDError.h similarity index 100% rename from Source/AppAuthCore/OIDError.h rename to Sources/AppAuthCore/OIDError.h diff --git a/Source/AppAuthCore/OIDError.m b/Sources/AppAuthCore/OIDError.m similarity index 100% rename from Source/AppAuthCore/OIDError.m rename to Sources/AppAuthCore/OIDError.m diff --git a/Source/AppAuthCore/OIDErrorUtilities.h b/Sources/AppAuthCore/OIDErrorUtilities.h similarity index 100% rename from Source/AppAuthCore/OIDErrorUtilities.h rename to Sources/AppAuthCore/OIDErrorUtilities.h diff --git a/Source/AppAuthCore/OIDErrorUtilities.m b/Sources/AppAuthCore/OIDErrorUtilities.m similarity index 100% rename from Source/AppAuthCore/OIDErrorUtilities.m rename to Sources/AppAuthCore/OIDErrorUtilities.m diff --git a/Source/AppAuthCore/OIDExternalUserAgent.h b/Sources/AppAuthCore/OIDExternalUserAgent.h similarity index 100% rename from Source/AppAuthCore/OIDExternalUserAgent.h rename to Sources/AppAuthCore/OIDExternalUserAgent.h diff --git a/Source/AppAuthCore/OIDExternalUserAgentRequest.h b/Sources/AppAuthCore/OIDExternalUserAgentRequest.h similarity index 100% rename from Source/AppAuthCore/OIDExternalUserAgentRequest.h rename to Sources/AppAuthCore/OIDExternalUserAgentRequest.h diff --git a/Source/AppAuthCore/OIDExternalUserAgentSession.h b/Sources/AppAuthCore/OIDExternalUserAgentSession.h similarity index 100% rename from Source/AppAuthCore/OIDExternalUserAgentSession.h rename to Sources/AppAuthCore/OIDExternalUserAgentSession.h diff --git a/Source/AppAuthCore/OIDFieldMapping.h b/Sources/AppAuthCore/OIDFieldMapping.h similarity index 100% rename from Source/AppAuthCore/OIDFieldMapping.h rename to Sources/AppAuthCore/OIDFieldMapping.h diff --git a/Source/AppAuthCore/OIDFieldMapping.m b/Sources/AppAuthCore/OIDFieldMapping.m similarity index 100% rename from Source/AppAuthCore/OIDFieldMapping.m rename to Sources/AppAuthCore/OIDFieldMapping.m diff --git a/Source/AppAuthCore/OIDGrantTypes.h b/Sources/AppAuthCore/OIDGrantTypes.h similarity index 100% rename from Source/AppAuthCore/OIDGrantTypes.h rename to Sources/AppAuthCore/OIDGrantTypes.h diff --git a/Source/AppAuthCore/OIDGrantTypes.m b/Sources/AppAuthCore/OIDGrantTypes.m similarity index 100% rename from Source/AppAuthCore/OIDGrantTypes.m rename to Sources/AppAuthCore/OIDGrantTypes.m diff --git a/Source/AppAuthCore/OIDIDToken.h b/Sources/AppAuthCore/OIDIDToken.h similarity index 100% rename from Source/AppAuthCore/OIDIDToken.h rename to Sources/AppAuthCore/OIDIDToken.h diff --git a/Source/AppAuthCore/OIDIDToken.m b/Sources/AppAuthCore/OIDIDToken.m similarity index 100% rename from Source/AppAuthCore/OIDIDToken.m rename to Sources/AppAuthCore/OIDIDToken.m diff --git a/Source/AppAuthCore/OIDRegistrationRequest.h b/Sources/AppAuthCore/OIDRegistrationRequest.h similarity index 100% rename from Source/AppAuthCore/OIDRegistrationRequest.h rename to Sources/AppAuthCore/OIDRegistrationRequest.h diff --git a/Source/AppAuthCore/OIDRegistrationRequest.m b/Sources/AppAuthCore/OIDRegistrationRequest.m similarity index 100% rename from Source/AppAuthCore/OIDRegistrationRequest.m rename to Sources/AppAuthCore/OIDRegistrationRequest.m diff --git a/Source/AppAuthCore/OIDRegistrationResponse.h b/Sources/AppAuthCore/OIDRegistrationResponse.h similarity index 100% rename from Source/AppAuthCore/OIDRegistrationResponse.h rename to Sources/AppAuthCore/OIDRegistrationResponse.h diff --git a/Source/AppAuthCore/OIDRegistrationResponse.m b/Sources/AppAuthCore/OIDRegistrationResponse.m similarity index 100% rename from Source/AppAuthCore/OIDRegistrationResponse.m rename to Sources/AppAuthCore/OIDRegistrationResponse.m diff --git a/Source/AppAuthCore/OIDResponseTypes.h b/Sources/AppAuthCore/OIDResponseTypes.h similarity index 100% rename from Source/AppAuthCore/OIDResponseTypes.h rename to Sources/AppAuthCore/OIDResponseTypes.h diff --git a/Source/AppAuthCore/OIDResponseTypes.m b/Sources/AppAuthCore/OIDResponseTypes.m similarity index 100% rename from Source/AppAuthCore/OIDResponseTypes.m rename to Sources/AppAuthCore/OIDResponseTypes.m diff --git a/Source/AppAuthCore/OIDScopeUtilities.h b/Sources/AppAuthCore/OIDScopeUtilities.h similarity index 100% rename from Source/AppAuthCore/OIDScopeUtilities.h rename to Sources/AppAuthCore/OIDScopeUtilities.h diff --git a/Source/AppAuthCore/OIDScopeUtilities.m b/Sources/AppAuthCore/OIDScopeUtilities.m similarity index 100% rename from Source/AppAuthCore/OIDScopeUtilities.m rename to Sources/AppAuthCore/OIDScopeUtilities.m diff --git a/Source/AppAuthCore/OIDScopes.h b/Sources/AppAuthCore/OIDScopes.h similarity index 100% rename from Source/AppAuthCore/OIDScopes.h rename to Sources/AppAuthCore/OIDScopes.h diff --git a/Source/AppAuthCore/OIDScopes.m b/Sources/AppAuthCore/OIDScopes.m similarity index 100% rename from Source/AppAuthCore/OIDScopes.m rename to Sources/AppAuthCore/OIDScopes.m diff --git a/Source/AppAuthCore/OIDServiceConfiguration.h b/Sources/AppAuthCore/OIDServiceConfiguration.h similarity index 100% rename from Source/AppAuthCore/OIDServiceConfiguration.h rename to Sources/AppAuthCore/OIDServiceConfiguration.h diff --git a/Source/AppAuthCore/OIDServiceConfiguration.m b/Sources/AppAuthCore/OIDServiceConfiguration.m similarity index 100% rename from Source/AppAuthCore/OIDServiceConfiguration.m rename to Sources/AppAuthCore/OIDServiceConfiguration.m diff --git a/Source/AppAuthCore/OIDServiceDiscovery.h b/Sources/AppAuthCore/OIDServiceDiscovery.h similarity index 100% rename from Source/AppAuthCore/OIDServiceDiscovery.h rename to Sources/AppAuthCore/OIDServiceDiscovery.h diff --git a/Source/AppAuthCore/OIDServiceDiscovery.m b/Sources/AppAuthCore/OIDServiceDiscovery.m similarity index 100% rename from Source/AppAuthCore/OIDServiceDiscovery.m rename to Sources/AppAuthCore/OIDServiceDiscovery.m diff --git a/Source/AppAuthCore/OIDTokenRequest.h b/Sources/AppAuthCore/OIDTokenRequest.h similarity index 100% rename from Source/AppAuthCore/OIDTokenRequest.h rename to Sources/AppAuthCore/OIDTokenRequest.h diff --git a/Source/AppAuthCore/OIDTokenRequest.m b/Sources/AppAuthCore/OIDTokenRequest.m similarity index 100% rename from Source/AppAuthCore/OIDTokenRequest.m rename to Sources/AppAuthCore/OIDTokenRequest.m diff --git a/Source/AppAuthCore/OIDTokenResponse.h b/Sources/AppAuthCore/OIDTokenResponse.h similarity index 100% rename from Source/AppAuthCore/OIDTokenResponse.h rename to Sources/AppAuthCore/OIDTokenResponse.h diff --git a/Source/AppAuthCore/OIDTokenResponse.m b/Sources/AppAuthCore/OIDTokenResponse.m similarity index 100% rename from Source/AppAuthCore/OIDTokenResponse.m rename to Sources/AppAuthCore/OIDTokenResponse.m diff --git a/Source/AppAuthCore/OIDTokenUtilities.h b/Sources/AppAuthCore/OIDTokenUtilities.h similarity index 100% rename from Source/AppAuthCore/OIDTokenUtilities.h rename to Sources/AppAuthCore/OIDTokenUtilities.h diff --git a/Source/AppAuthCore/OIDTokenUtilities.m b/Sources/AppAuthCore/OIDTokenUtilities.m similarity index 100% rename from Source/AppAuthCore/OIDTokenUtilities.m rename to Sources/AppAuthCore/OIDTokenUtilities.m diff --git a/Source/AppAuthCore/OIDURLQueryComponent.h b/Sources/AppAuthCore/OIDURLQueryComponent.h similarity index 100% rename from Source/AppAuthCore/OIDURLQueryComponent.h rename to Sources/AppAuthCore/OIDURLQueryComponent.h diff --git a/Source/AppAuthCore/OIDURLQueryComponent.m b/Sources/AppAuthCore/OIDURLQueryComponent.m similarity index 100% rename from Source/AppAuthCore/OIDURLQueryComponent.m rename to Sources/AppAuthCore/OIDURLQueryComponent.m diff --git a/Source/AppAuthCore/OIDURLSessionProvider.h b/Sources/AppAuthCore/OIDURLSessionProvider.h similarity index 100% rename from Source/AppAuthCore/OIDURLSessionProvider.h rename to Sources/AppAuthCore/OIDURLSessionProvider.h diff --git a/Source/AppAuthCore/OIDURLSessionProvider.m b/Sources/AppAuthCore/OIDURLSessionProvider.m similarity index 100% rename from Source/AppAuthCore/OIDURLSessionProvider.m rename to Sources/AppAuthCore/OIDURLSessionProvider.m diff --git a/Sources/AppAuthCore/Resources/PrivacyInfo.xcprivacy b/Sources/AppAuthCore/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 000000000..cc6746dcb --- /dev/null +++ b/Sources/AppAuthCore/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,16 @@ + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyCollectedDataTypes + + + NSPrivacyTrackingDomains + + NSPrivacyTracking + + + diff --git a/Source/AppAuthTV.h b/Sources/AppAuthTV.h similarity index 100% rename from Source/AppAuthTV.h rename to Sources/AppAuthTV.h diff --git a/Source/AppAuthTV/OIDTVAuthorizationRequest.h b/Sources/AppAuthTV/OIDTVAuthorizationRequest.h similarity index 100% rename from Source/AppAuthTV/OIDTVAuthorizationRequest.h rename to Sources/AppAuthTV/OIDTVAuthorizationRequest.h diff --git a/Source/AppAuthTV/OIDTVAuthorizationRequest.m b/Sources/AppAuthTV/OIDTVAuthorizationRequest.m similarity index 100% rename from Source/AppAuthTV/OIDTVAuthorizationRequest.m rename to Sources/AppAuthTV/OIDTVAuthorizationRequest.m diff --git a/Source/AppAuthTV/OIDTVAuthorizationResponse.h b/Sources/AppAuthTV/OIDTVAuthorizationResponse.h similarity index 100% rename from Source/AppAuthTV/OIDTVAuthorizationResponse.h rename to Sources/AppAuthTV/OIDTVAuthorizationResponse.h diff --git a/Source/AppAuthTV/OIDTVAuthorizationResponse.m b/Sources/AppAuthTV/OIDTVAuthorizationResponse.m similarity index 100% rename from Source/AppAuthTV/OIDTVAuthorizationResponse.m rename to Sources/AppAuthTV/OIDTVAuthorizationResponse.m diff --git a/Source/AppAuthTV/OIDTVAuthorizationService.h b/Sources/AppAuthTV/OIDTVAuthorizationService.h similarity index 100% rename from Source/AppAuthTV/OIDTVAuthorizationService.h rename to Sources/AppAuthTV/OIDTVAuthorizationService.h diff --git a/Source/AppAuthTV/OIDTVAuthorizationService.m b/Sources/AppAuthTV/OIDTVAuthorizationService.m similarity index 100% rename from Source/AppAuthTV/OIDTVAuthorizationService.m rename to Sources/AppAuthTV/OIDTVAuthorizationService.m diff --git a/Source/AppAuthTV/OIDTVServiceConfiguration.h b/Sources/AppAuthTV/OIDTVServiceConfiguration.h similarity index 100% rename from Source/AppAuthTV/OIDTVServiceConfiguration.h rename to Sources/AppAuthTV/OIDTVServiceConfiguration.h diff --git a/Source/AppAuthTV/OIDTVServiceConfiguration.m b/Sources/AppAuthTV/OIDTVServiceConfiguration.m similarity index 100% rename from Source/AppAuthTV/OIDTVServiceConfiguration.m rename to Sources/AppAuthTV/OIDTVServiceConfiguration.m diff --git a/Source/AppAuthTV/OIDTVTokenRequest.h b/Sources/AppAuthTV/OIDTVTokenRequest.h similarity index 100% rename from Source/AppAuthTV/OIDTVTokenRequest.h rename to Sources/AppAuthTV/OIDTVTokenRequest.h diff --git a/Source/AppAuthTV/OIDTVTokenRequest.m b/Sources/AppAuthTV/OIDTVTokenRequest.m similarity index 100% rename from Source/AppAuthTV/OIDTVTokenRequest.m rename to Sources/AppAuthTV/OIDTVTokenRequest.m diff --git a/Sources/AppAuthTV/Resources/PrivacyInfo.xcprivacy b/Sources/AppAuthTV/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 000000000..cc6746dcb --- /dev/null +++ b/Sources/AppAuthTV/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,16 @@ + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyCollectedDataTypes + + + NSPrivacyTrackingDomains + + NSPrivacyTracking + + + diff --git a/Source/CoreFramework/AppAuthCore.h b/Sources/CoreFramework/AppAuthCore.h similarity index 100% rename from Source/CoreFramework/AppAuthCore.h rename to Sources/CoreFramework/AppAuthCore.h diff --git a/Source/CoreFramework/Info.plist b/Sources/CoreFramework/Info.plist similarity index 100% rename from Source/CoreFramework/Info.plist rename to Sources/CoreFramework/Info.plist diff --git a/Source/Framework/AppAuth.h b/Sources/Framework/AppAuth.h similarity index 100% rename from Source/Framework/AppAuth.h rename to Sources/Framework/AppAuth.h diff --git a/Source/Framework/Info.plist b/Sources/Framework/Info.plist similarity index 100% rename from Source/Framework/Info.plist rename to Sources/Framework/Info.plist diff --git a/Source/TVFramework/AppAuthTV.h b/Sources/TVFramework/AppAuthTV.h similarity index 100% rename from Source/TVFramework/AppAuthTV.h rename to Sources/TVFramework/AppAuthTV.h diff --git a/Source/TVFramework/Info.plist b/Sources/TVFramework/Info.plist similarity index 100% rename from Source/TVFramework/Info.plist rename to Sources/TVFramework/Info.plist diff --git a/UnitTests/AppAuthTV/OIDTVAuthorizationRequestTests.m b/UnitTests/AppAuthTV/OIDTVAuthorizationRequestTests.m index 7b1d19c95..a5ccd6e1d 100644 --- a/UnitTests/AppAuthTV/OIDTVAuthorizationRequestTests.m +++ b/UnitTests/AppAuthTV/OIDTVAuthorizationRequestTests.m @@ -21,10 +21,10 @@ #if SWIFT_PACKAGE @import AppAuthTV; #else -#import "Source/AppAuthCore/OIDScopeUtilities.h" -#import "Source/AppAuthCore/OIDURLQueryComponent.h" -#import "Source/AppAuthTV/OIDTVAuthorizationRequest.h" -#import "Source/AppAuthTV/OIDTVServiceConfiguration.h" +#import "Sources/AppAuthCore/OIDScopeUtilities.h" +#import "Sources/AppAuthCore/OIDURLQueryComponent.h" +#import "Sources/AppAuthTV/OIDTVAuthorizationRequest.h" +#import "Sources/AppAuthTV/OIDTVServiceConfiguration.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.m b/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.m index 288228e88..436232322 100644 --- a/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.m +++ b/UnitTests/AppAuthTV/OIDTVAuthorizationResponseTests.m @@ -21,12 +21,12 @@ #if SWIFT_PACKAGE @import AppAuthTV; #else -#import "Source/AppAuthCore/OIDScopeUtilities.h" -#import "Source/AppAuthCore/OIDURLQueryComponent.h" -#import "Source/AppAuthTV/OIDTVAuthorizationRequest.h" -#import "Source/AppAuthTV/OIDTVAuthorizationResponse.h" -#import "Source/AppAuthTV/OIDTVServiceConfiguration.h" -#import "Source/AppAuthTV/OIDTVTokenRequest.h" +#import "Sources/AppAuthCore/OIDScopeUtilities.h" +#import "Sources/AppAuthCore/OIDURLQueryComponent.h" +#import "Sources/AppAuthTV/OIDTVAuthorizationRequest.h" +#import "Sources/AppAuthTV/OIDTVAuthorizationResponse.h" +#import "Sources/AppAuthTV/OIDTVServiceConfiguration.h" +#import "Sources/AppAuthTV/OIDTVTokenRequest.h" #endif /*! @brief Test value for the @c deviceAuthorizationEndpoint property. diff --git a/UnitTests/AppAuthTV/OIDTVTokenRequestTests.m b/UnitTests/AppAuthTV/OIDTVTokenRequestTests.m index 4778a227b..cd56344fd 100644 --- a/UnitTests/AppAuthTV/OIDTVTokenRequestTests.m +++ b/UnitTests/AppAuthTV/OIDTVTokenRequestTests.m @@ -21,11 +21,11 @@ #if SWIFT_PACKAGE @import AppAuthTV; #else -#import "Source/AppAuthCore/OIDScopeUtilities.h" -#import "Source/AppAuthTV/OIDTVAuthorizationRequest.h" -#import "Source/AppAuthTV/OIDTVAuthorizationResponse.h" -#import "Source/AppAuthTV/OIDTVServiceConfiguration.h" -#import "Source/AppAuthTV/OIDTVTokenRequest.h" +#import "Sources/AppAuthCore/OIDScopeUtilities.h" +#import "Sources/AppAuthTV/OIDTVAuthorizationRequest.h" +#import "Sources/AppAuthTV/OIDTVAuthorizationResponse.h" +#import "Sources/AppAuthTV/OIDTVServiceConfiguration.h" +#import "Sources/AppAuthTV/OIDTVTokenRequest.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is diff --git a/UnitTests/OIDAuthStateTests.h b/UnitTests/OIDAuthStateTests.h index 2f1a62ab1..3bd1eb6fb 100644 --- a/UnitTests/OIDAuthStateTests.h +++ b/UnitTests/OIDAuthStateTests.h @@ -21,8 +21,8 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDAuthStateChangeDelegate.h" -#import "Source/AppAuthCore/OIDAuthStateErrorDelegate.h" +#import "Sources/AppAuthCore/OIDAuthStateChangeDelegate.h" +#import "Sources/AppAuthCore/OIDAuthStateErrorDelegate.h" #endif @class OIDAuthState; diff --git a/UnitTests/OIDAuthStateTests.m b/UnitTests/OIDAuthStateTests.m index d12f2a831..051902833 100644 --- a/UnitTests/OIDAuthStateTests.m +++ b/UnitTests/OIDAuthStateTests.m @@ -25,11 +25,11 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDAuthState.h" -#import "Source/AppAuthCore/OIDAuthorizationResponse.h" -#import "Source/AppAuthCore/OIDErrorUtilities.h" -#import "Source/AppAuthCore/OIDRegistrationResponse.h" -#import "Source/AppAuthCore/OIDTokenResponse.h" +#import "Sources/AppAuthCore/OIDAuthState.h" +#import "Sources/AppAuthCore/OIDAuthorizationResponse.h" +#import "Sources/AppAuthCore/OIDErrorUtilities.h" +#import "Sources/AppAuthCore/OIDRegistrationResponse.h" +#import "Sources/AppAuthCore/OIDTokenResponse.h" #endif #import "OIDTokenRequestTests.h" diff --git a/UnitTests/OIDAuthorizationRequestTests.m b/UnitTests/OIDAuthorizationRequestTests.m index 92ed8ee05..dd1329383 100644 --- a/UnitTests/OIDAuthorizationRequestTests.m +++ b/UnitTests/OIDAuthorizationRequestTests.m @@ -23,9 +23,9 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDAuthorizationRequest.h" -#import "Source/AppAuthCore/OIDScopeUtilities.h" -#import "Source/AppAuthCore/OIDServiceConfiguration.h" +#import "Sources/AppAuthCore/OIDAuthorizationRequest.h" +#import "Sources/AppAuthCore/OIDScopeUtilities.h" +#import "Sources/AppAuthCore/OIDServiceConfiguration.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDAuthorizationResponseTests.m b/UnitTests/OIDAuthorizationResponseTests.m index 10e48eaa8..3aded7eaa 100644 --- a/UnitTests/OIDAuthorizationResponseTests.m +++ b/UnitTests/OIDAuthorizationResponseTests.m @@ -23,9 +23,9 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDAuthorizationRequest.h" -#import "Source/AppAuthCore/OIDAuthorizationResponse.h" -#import "Source/AppAuthCore/OIDGrantTypes.h" +#import "Sources/AppAuthCore/OIDAuthorizationRequest.h" +#import "Sources/AppAuthCore/OIDAuthorizationResponse.h" +#import "Sources/AppAuthCore/OIDGrantTypes.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDEndSessionRequestTests.m b/UnitTests/OIDEndSessionRequestTests.m index 4620d3b82..38543c8d3 100644 --- a/UnitTests/OIDEndSessionRequestTests.m +++ b/UnitTests/OIDEndSessionRequestTests.m @@ -23,9 +23,9 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDEndSessionRequest.h" -#import "Source/AppAuthCore/OIDServiceConfiguration.h" -#import "Source/AppAuthCore/OIDServiceDiscovery.h" +#import "Sources/AppAuthCore/OIDEndSessionRequest.h" +#import "Sources/AppAuthCore/OIDServiceConfiguration.h" +#import "Sources/AppAuthCore/OIDServiceDiscovery.h" #endif /*! @brief Test value for the @c redirectURL property. diff --git a/UnitTests/OIDGrantTypesTests.m b/UnitTests/OIDGrantTypesTests.m index 8c06d5701..b6efc8ea1 100644 --- a/UnitTests/OIDGrantTypesTests.m +++ b/UnitTests/OIDGrantTypesTests.m @@ -21,7 +21,7 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDGrantTypes.h" +#import "Sources/AppAuthCore/OIDGrantTypes.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDRegistrationRequestTests.m b/UnitTests/OIDRegistrationRequestTests.m index 5fbbd585e..440dab2a5 100644 --- a/UnitTests/OIDRegistrationRequestTests.m +++ b/UnitTests/OIDRegistrationRequestTests.m @@ -23,9 +23,9 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDClientMetadataParameters.h" -#import "Source/AppAuthCore/OIDRegistrationRequest.h" -#import "Source/AppAuthCore/OIDServiceConfiguration.h" +#import "Sources/AppAuthCore/OIDClientMetadataParameters.h" +#import "Sources/AppAuthCore/OIDRegistrationRequest.h" +#import "Sources/AppAuthCore/OIDServiceConfiguration.h" #endif /*! @brief Test key for the @c additionalParameters property. diff --git a/UnitTests/OIDRegistrationResponseTests.m b/UnitTests/OIDRegistrationResponseTests.m index f747cc244..92e57e338 100644 --- a/UnitTests/OIDRegistrationResponseTests.m +++ b/UnitTests/OIDRegistrationResponseTests.m @@ -24,8 +24,8 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDRegistrationRequest.h" -#import "Source/AppAuthCore/OIDRegistrationResponse.h" +#import "Sources/AppAuthCore/OIDRegistrationRequest.h" +#import "Sources/AppAuthCore/OIDRegistrationResponse.h" #endif /*! @brief The test value for the @c clientID property. diff --git a/UnitTests/OIDResponseTypesTests.m b/UnitTests/OIDResponseTypesTests.m index 5402ebbf5..659597735 100644 --- a/UnitTests/OIDResponseTypesTests.m +++ b/UnitTests/OIDResponseTypesTests.m @@ -21,7 +21,7 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDResponseTypes.h" +#import "Sources/AppAuthCore/OIDResponseTypes.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDScopesTests.m b/UnitTests/OIDScopesTests.m index 2d9173748..b5276ebd8 100644 --- a/UnitTests/OIDScopesTests.m +++ b/UnitTests/OIDScopesTests.m @@ -21,7 +21,7 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDScopes.h" +#import "Sources/AppAuthCore/OIDScopes.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDServiceConfigurationTests.m b/UnitTests/OIDServiceConfigurationTests.m index 3be785e60..7f4fcb11c 100644 --- a/UnitTests/OIDServiceConfigurationTests.m +++ b/UnitTests/OIDServiceConfigurationTests.m @@ -25,10 +25,10 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDAuthorizationService.h" -#import "Source/AppAuthCore/OIDError.h" -#import "Source/AppAuthCore/OIDServiceConfiguration.h" -#import "Source/AppAuthCore/OIDServiceDiscovery.h" +#import "Sources/AppAuthCore/OIDAuthorizationService.h" +#import "Sources/AppAuthCore/OIDError.h" +#import "Sources/AppAuthCore/OIDServiceConfiguration.h" +#import "Sources/AppAuthCore/OIDServiceDiscovery.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDServiceDiscoveryTests.m b/UnitTests/OIDServiceDiscoveryTests.m index 6329feab3..6d9faf799 100644 --- a/UnitTests/OIDServiceDiscoveryTests.m +++ b/UnitTests/OIDServiceDiscoveryTests.m @@ -21,8 +21,8 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDError.h" -#import "Source/AppAuthCore/OIDServiceDiscovery.h" +#import "Sources/AppAuthCore/OIDError.h" +#import "Sources/AppAuthCore/OIDServiceDiscovery.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDTokenRequestTests.m b/UnitTests/OIDTokenRequestTests.m index 20ba691ca..c387bd809 100644 --- a/UnitTests/OIDTokenRequestTests.m +++ b/UnitTests/OIDTokenRequestTests.m @@ -24,11 +24,11 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDAuthorizationRequest.h" -#import "Source/AppAuthCore/OIDAuthorizationResponse.h" -#import "Source/AppAuthCore/OIDScopeUtilities.h" -#import "Source/AppAuthCore/OIDServiceConfiguration.h" -#import "Source/AppAuthCore/OIDTokenRequest.h" +#import "Sources/AppAuthCore/OIDAuthorizationRequest.h" +#import "Sources/AppAuthCore/OIDAuthorizationResponse.h" +#import "Sources/AppAuthCore/OIDScopeUtilities.h" +#import "Sources/AppAuthCore/OIDServiceConfiguration.h" +#import "Sources/AppAuthCore/OIDTokenRequest.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDTokenResponseTests.m b/UnitTests/OIDTokenResponseTests.m index 5d0a8f8ae..0eb525ed0 100644 --- a/UnitTests/OIDTokenResponseTests.m +++ b/UnitTests/OIDTokenResponseTests.m @@ -23,8 +23,8 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDTokenRequest.h" -#import "Source/AppAuthCore/OIDTokenResponse.h" +#import "Sources/AppAuthCore/OIDTokenRequest.h" +#import "Sources/AppAuthCore/OIDTokenResponse.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDTokenUtilitiesTests.m b/UnitTests/OIDTokenUtilitiesTests.m index 0a7ff15ec..783e81273 100644 --- a/UnitTests/OIDTokenUtilitiesTests.m +++ b/UnitTests/OIDTokenUtilitiesTests.m @@ -21,7 +21,7 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDTokenUtilities.h" +#import "Sources/AppAuthCore/OIDTokenUtilities.h" #endif @interface OIDTokenUtilitiesTests : XCTestCase diff --git a/UnitTests/OIDURLQueryComponentTests.m b/UnitTests/OIDURLQueryComponentTests.m index d0eec3e5c..eac017c43 100644 --- a/UnitTests/OIDURLQueryComponentTests.m +++ b/UnitTests/OIDURLQueryComponentTests.m @@ -21,7 +21,7 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDURLQueryComponent.h" +#import "Sources/AppAuthCore/OIDURLQueryComponent.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of diff --git a/UnitTests/OIDURLQueryComponentTestsIOS7.m b/UnitTests/OIDURLQueryComponentTestsIOS7.m index af26ef107..571f61bba 100644 --- a/UnitTests/OIDURLQueryComponentTestsIOS7.m +++ b/UnitTests/OIDURLQueryComponentTestsIOS7.m @@ -21,7 +21,7 @@ #if SWIFT_PACKAGE @import AppAuthCore; #else -#import "Source/AppAuthCore/OIDURLQueryComponent.h" +#import "Sources/AppAuthCore/OIDURLQueryComponent.h" #endif // Ignore warnings about "Use of GNU statement expression extension" which is raised by our use of From 7e2c09cbeb3bb799f26c268dbedb26325ea722a9 Mon Sep 17 00:00:00 2001 From: mdmathias Date: Wed, 13 Mar 2024 16:06:30 -0700 Subject: [PATCH 13/13] Prepare for 1.7.3 release (#834) --- AppAuth.podspec | 2 +- CHANGELOG.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AppAuth.podspec b/AppAuth.podspec index 70f3e4168..393dad42a 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "AppAuth" - s.version = "1.7.2" + s.version = "1.7.3" s.summary = "AppAuth for iOS and macOS is a client SDK for communicating with OAuth 2.0 and OpenID Connect providers." s.description = <<-DESC diff --git a/CHANGELOG.md b/CHANGELOG.md index 12e915e1b..6411e5afb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.7.3 +- Fix missing manifest in bundle using SPM ([#833](https://github.com/openid/AppAuth-iOS/pull/833)) + # 1.7.2 - Streamline copying of privacy manifest ([#830](https://github.com/openid/AppAuth-iOS/pull/830))