diff --git a/IdentityCore/src/MSIDOAuth2Constants.h b/IdentityCore/src/MSIDOAuth2Constants.h index b633e0819..133a254f0 100644 --- a/IdentityCore/src/MSIDOAuth2Constants.h +++ b/IdentityCore/src/MSIDOAuth2Constants.h @@ -180,5 +180,5 @@ extern NSString *const MSID_CCS_REQUEST_ID_RESPONSE; extern NSString *const MSID_CCS_REQUEST_SEQUENCE_KEY; extern NSString *const MSID_CCS_REQUEST_SEQUENCE_RESPONSE; extern NSString *const MSID_BOUND_DEVICE_ID_CACHE_KEY; +extern NSString *const MSID_BOUND_RT_EXCHANGE; extern NSString *const MSID_MSAL_CLIENT_APV_PREFIX; -extern NSString *const MSID_BOUND_REFRESH_TOKEN_EXCHANGE; diff --git a/IdentityCore/src/MSIDOAuth2Constants.m b/IdentityCore/src/MSIDOAuth2Constants.m index b9a186bb8..bbe889acc 100644 --- a/IdentityCore/src/MSIDOAuth2Constants.m +++ b/IdentityCore/src/MSIDOAuth2Constants.m @@ -180,6 +180,6 @@ NSString *const MSID_CCS_REQUEST_SEQUENCE_KEY = @"x-ms-srs"; NSString *const MSID_CCS_REQUEST_SEQUENCE_RESPONSE = @"ccs-request-sequence"; -NSString *const MSID_BOUND_REFRESH_TOKEN_EXCHANGE = @"bound_rt_exchange"; NSString *const MSID_BOUND_DEVICE_ID_CACHE_KEY = @"bound_device_id"; +NSString *const MSID_BOUND_RT_EXCHANGE = @"bound_rt_exchange"; NSString *const MSID_MSAL_CLIENT_APV_PREFIX = @"MsalClient"; diff --git a/IdentityCore/src/parameters/MSIDBoundRefreshTokenRedemptionParameters.m b/IdentityCore/src/parameters/MSIDBoundRefreshTokenRedemptionParameters.m index cb1acc135..4f1c6ef34 100644 --- a/IdentityCore/src/parameters/MSIDBoundRefreshTokenRedemptionParameters.m +++ b/IdentityCore/src/parameters/MSIDBoundRefreshTokenRedemptionParameters.m @@ -70,7 +70,7 @@ - (nonnull NSMutableDictionary *)jsonDictionary { NSMutableDictionary *jsonDict = [NSMutableDictionary new]; jsonDict[MSID_OAUTH2_GRANT_TYPE] = MSID_OAUTH2_REFRESH_TOKEN; - jsonDict[MSID_BOUND_REFRESH_TOKEN_EXCHANGE] = @1; + jsonDict[MSID_BOUND_RT_EXCHANGE] = @1; jsonDict[@"aud"] = self.audience; jsonDict[@"iss"] = self.clientId; // Issuer is the client ID NSTimeInterval now = [[NSDate date] timeIntervalSince1970]; diff --git a/IdentityCore/src/parameters/MSIDRequestParameters.h b/IdentityCore/src/parameters/MSIDRequestParameters.h index 314dde255..691b64bef 100644 --- a/IdentityCore/src/parameters/MSIDRequestParameters.h +++ b/IdentityCore/src/parameters/MSIDRequestParameters.h @@ -122,6 +122,9 @@ - (NSURL *)tokenEndpoint; +// property that indicates if calling app requested broker for a Bound App Refresh token +@property (nonatomic) BOOL isBoundAppRefreshTokenRequested; + #pragma mark Methods - (void)setCloudAuthorityWithCloudHostName:(NSString *)cloudHostName; - (NSString *)allTokenRequestScopes; diff --git a/IdentityCore/tests/MSIDBoundRefreshTokenRedemptionTests.m b/IdentityCore/tests/MSIDBoundRefreshTokenRedemptionTests.m index bfbb51abd..611dae62a 100644 --- a/IdentityCore/tests/MSIDBoundRefreshTokenRedemptionTests.m +++ b/IdentityCore/tests/MSIDBoundRefreshTokenRedemptionTests.m @@ -889,7 +889,7 @@ - (void)testJsonDictionary_verifyAllRequiredFields_shouldBePresent // Verify all expected keys are present NSArray *expectedKeys = @[ MSID_OAUTH2_GRANT_TYPE, - MSID_BOUND_REFRESH_TOKEN_EXCHANGE, + MSID_BOUND_RT_EXCHANGE, @"iss", @"iat", @"exp", @@ -950,7 +950,7 @@ - (void)testJsonDictionary_boundRefreshTokenExchangeValue_shouldBeNumberOne NSMutableDictionary *jsonDict = [params jsonDictionary]; // Verify the bound_refresh_token_exchange is exactly @1 (NSNumber with value 1) - id boundExchangeValue = jsonDict[MSID_BOUND_REFRESH_TOKEN_EXCHANGE]; + id boundExchangeValue = jsonDict[MSID_BOUND_RT_EXCHANGE]; XCTAssertTrue([boundExchangeValue isKindOfClass:[NSNumber class]]); XCTAssertEqualObjects(boundExchangeValue, @1); XCTAssertEqual([boundExchangeValue intValue], 1); @@ -1098,7 +1098,7 @@ - (void)validateJwtValidity:(NSString *)jwt params:(MSIDBoundRefreshTokenRedempt XCTAssertFalse([payloadObject[@"scope"] containsString:@"aza"]); XCTAssertEqualObjects(payloadObject[@"refresh_token"], refreshToken); XCTAssertEqualObjects(payloadObject[@"grant_type"], @"refresh_token"); - XCTAssertEqualObjects(payloadObject[MSID_BOUND_REFRESH_TOKEN_EXCHANGE], @1); + XCTAssertEqualObjects(payloadObject[MSID_BOUND_RT_EXCHANGE], @1); XCTAssertNotNil(payloadObject[@"iat"]); XCTAssertNotNil(payloadObject[@"nbf"]); XCTAssertNotNil(payloadObject[@"exp"]);