Commit d116b48 1 parent d1248e6 commit d116b48 Copy full SHA for d116b48
File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -89,13 +89,15 @@ private void CanDecryptV4TokenEncodedAsBase64(IdentityScope identityScope)
89
89
Refresh ( KeyBidstreamResponse ( new [ ] { MASTER_KEY , SITE_KEY } , identityScope ) ) ;
90
90
91
91
var now = DateTime . UtcNow ;
92
- var advertisingTokenBase64Url = AdvertisingTokenBuilder . Builder ( ) . WithVersion ( TokenVersion . V4 ) . WithScope ( identityScope ) . WithEstablished ( now . AddMonths ( - 4 ) ) . WithGenerated ( now . AddDays ( - 1 ) ) . WithExpiry ( now . AddDays ( 2 ) ) . Build ( ) ;
93
92
94
- var tokenAsBinary = UID2Base64UrlCoder . Decode ( advertisingTokenBase64Url ) ;
95
- var advertisingTokenBase64 = Convert . ToBase64String ( tokenAsBinary ) ;
96
- Assert . True ( advertisingTokenBase64 . Contains ( "=" ) ) ;
97
- Assert . True ( advertisingTokenBase64 . Contains ( "/" ) ) ;
98
- Assert . True ( advertisingTokenBase64 . Contains ( "+" ) ) ;
93
+ string advertisingTokenBase64 ;
94
+ do
95
+ {
96
+ var advertisingTokenBase64Url = AdvertisingTokenBuilder . Builder ( ) . WithVersion ( TokenVersion . V4 ) . WithScope ( identityScope ) . WithEstablished ( now . AddMonths ( - 4 ) ) . WithGenerated ( now . AddDays ( - 1 ) ) . WithExpiry ( now . AddDays ( 2 ) ) . Build ( ) ;
97
+ var tokenAsBinary = UID2Base64UrlCoder . Decode ( advertisingTokenBase64Url ) ;
98
+ advertisingTokenBase64 = Convert . ToBase64String ( tokenAsBinary ) ;
99
+
100
+ } while ( ! advertisingTokenBase64 . Contains ( "=" ) || ! advertisingTokenBase64 . Contains ( "/" ) || ! advertisingTokenBase64 . Contains ( "+" ) ) ;
99
101
100
102
DecryptAndAssertSuccess ( advertisingTokenBase64 , TokenVersion . V4 ) ;
101
103
}
You can’t perform that action at this time.
0 commit comments