Skip to content

Commit 57ad23f

Browse files
authored
Merge pull request #1600 from AzureAD/ameyapat/requesting-bart-to-broker
Add isBoundAppRefreshTokenRequested property and constants for reques…
2 parents 36cc700 + 36c8df6 commit 57ad23f

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

IdentityCore/src/MSIDOAuth2Constants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,5 @@ extern NSString *const MSID_CCS_REQUEST_ID_RESPONSE;
180180
extern NSString *const MSID_CCS_REQUEST_SEQUENCE_KEY;
181181
extern NSString *const MSID_CCS_REQUEST_SEQUENCE_RESPONSE;
182182
extern NSString *const MSID_BOUND_DEVICE_ID_CACHE_KEY;
183+
extern NSString *const MSID_BOUND_RT_EXCHANGE;
183184
extern NSString *const MSID_MSAL_CLIENT_APV_PREFIX;
184-
extern NSString *const MSID_BOUND_REFRESH_TOKEN_EXCHANGE;

IdentityCore/src/MSIDOAuth2Constants.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,6 @@
180180
NSString *const MSID_CCS_REQUEST_SEQUENCE_KEY = @"x-ms-srs";
181181
NSString *const MSID_CCS_REQUEST_SEQUENCE_RESPONSE = @"ccs-request-sequence";
182182

183-
NSString *const MSID_BOUND_REFRESH_TOKEN_EXCHANGE = @"bound_rt_exchange";
184183
NSString *const MSID_BOUND_DEVICE_ID_CACHE_KEY = @"bound_device_id";
184+
NSString *const MSID_BOUND_RT_EXCHANGE = @"bound_rt_exchange";
185185
NSString *const MSID_MSAL_CLIENT_APV_PREFIX = @"MsalClient";

IdentityCore/src/parameters/MSIDBoundRefreshTokenRedemptionParameters.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ - (nonnull NSMutableDictionary *)jsonDictionary
7070
{
7171
NSMutableDictionary *jsonDict = [NSMutableDictionary new];
7272
jsonDict[MSID_OAUTH2_GRANT_TYPE] = MSID_OAUTH2_REFRESH_TOKEN;
73-
jsonDict[MSID_BOUND_REFRESH_TOKEN_EXCHANGE] = @1;
73+
jsonDict[MSID_BOUND_RT_EXCHANGE] = @1;
7474
jsonDict[@"aud"] = self.audience;
7575
jsonDict[@"iss"] = self.clientId; // Issuer is the client ID
7676
NSTimeInterval now = [[NSDate date] timeIntervalSince1970];

IdentityCore/src/parameters/MSIDRequestParameters.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@
122122

123123
- (NSURL *)tokenEndpoint;
124124

125+
// property that indicates if calling app requested broker for a Bound App Refresh token
126+
@property (nonatomic) BOOL isBoundAppRefreshTokenRequested;
127+
125128
#pragma mark Methods
126129
- (void)setCloudAuthorityWithCloudHostName:(NSString *)cloudHostName;
127130
- (NSString *)allTokenRequestScopes;

IdentityCore/tests/MSIDBoundRefreshTokenRedemptionTests.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ - (void)testJsonDictionary_verifyAllRequiredFields_shouldBePresent
889889
// Verify all expected keys are present
890890
NSArray *expectedKeys = @[
891891
MSID_OAUTH2_GRANT_TYPE,
892-
MSID_BOUND_REFRESH_TOKEN_EXCHANGE,
892+
MSID_BOUND_RT_EXCHANGE,
893893
@"iss",
894894
@"iat",
895895
@"exp",
@@ -950,7 +950,7 @@ - (void)testJsonDictionary_boundRefreshTokenExchangeValue_shouldBeNumberOne
950950
NSMutableDictionary *jsonDict = [params jsonDictionary];
951951

952952
// Verify the bound_refresh_token_exchange is exactly @1 (NSNumber with value 1)
953-
id boundExchangeValue = jsonDict[MSID_BOUND_REFRESH_TOKEN_EXCHANGE];
953+
id boundExchangeValue = jsonDict[MSID_BOUND_RT_EXCHANGE];
954954
XCTAssertTrue([boundExchangeValue isKindOfClass:[NSNumber class]]);
955955
XCTAssertEqualObjects(boundExchangeValue, @1);
956956
XCTAssertEqual([boundExchangeValue intValue], 1);
@@ -1098,7 +1098,7 @@ - (void)validateJwtValidity:(NSString *)jwt params:(MSIDBoundRefreshTokenRedempt
10981098
XCTAssertFalse([payloadObject[@"scope"] containsString:@"aza"]);
10991099
XCTAssertEqualObjects(payloadObject[@"refresh_token"], refreshToken);
11001100
XCTAssertEqualObjects(payloadObject[@"grant_type"], @"refresh_token");
1101-
XCTAssertEqualObjects(payloadObject[MSID_BOUND_REFRESH_TOKEN_EXCHANGE], @1);
1101+
XCTAssertEqualObjects(payloadObject[MSID_BOUND_RT_EXCHANGE], @1);
11021102
XCTAssertNotNil(payloadObject[@"iat"]);
11031103
XCTAssertNotNil(payloadObject[@"nbf"]);
11041104
XCTAssertNotNil(payloadObject[@"exp"]);

0 commit comments

Comments
 (0)