public MsalIdTokenCacheItem GetIdToken(MsalIdTokenCacheKey idTokenKey) { if (_idTokenCacheDictionary.TryGetValue(idTokenKey.ToString(), out var cacheItem)) { return(cacheItem); } return(null); }
public void DeleteIdToken(MsalIdTokenCacheKey cacheKey) { if (!_idTokenCacheDictionary.TryRemove(cacheKey.ToString(), out _)) { _logger.InfoPii( $"Cannot delete an id token because it was already deleted. Key {cacheKey}", "Cannot delete an id token because it was already deleted"); } }
public string GetIdToken(MsalIdTokenCacheKey idTokenKey) { var strKey = idTokenKey.ToString(); if (!IdTokenCacheDictionary.ContainsKey(strKey)) { return(null); } return(IdTokenCacheDictionary[strKey]); }
public string GetIdToken(MsalIdTokenCacheKey idTokenKey) { var keyStr = idTokenKey.ToString(); if (!_idTokenContainer.Values.ContainsKey(/*encodedKey*/ keyStr)) { return(null); } return(CoreHelpers.ByteArrayToString( GetCacheValue((ApplicationDataCompositeValue)_idTokenContainer.Values[ /*CoreCryptographyHelpers.CreateBase64UrlEncodedSha256Hash(idTokenKey)*/ keyStr]))); }
public void DeleteIdToken(MsalIdTokenCacheKey cacheKey) { Delete(cacheKey.ToString(), _idTokenSharedPreference.Edit()); }
public MsalIdTokenCacheItem GetIdToken(MsalIdTokenCacheKey idTokenKey) { return(MsalIdTokenCacheItem.FromJsonString(_idTokenSharedPreference.GetString(idTokenKey.ToString(), null))); }
public void MsalIdTokenCacheKey() { var key = new MsalIdTokenCacheKey("login.microsoftonline.com", "contoso.com", "uid.utid", "clientid"); Assert.AreEqual("uid.utid-login.microsoftonline.com-idtoken-clientid-contoso.com-", key.ToString()); Assert.AreEqual("uid.utid-login.microsoftonline.com", key.iOSAccount); Assert.AreEqual("idtoken-clientid-contoso.com-", key.iOSService); Assert.AreEqual("idtoken-clientid-contoso.com", key.iOSGeneric); Assert.AreEqual((int)MsalCacheKeys.iOSCredentialAttrType.IdToken, key.iOSType); }
public void MsalIdTokenCacheKey() { MsalIdTokenCacheKey key = new MsalIdTokenCacheKey("login.microsoftonline.com", "contoso.com", "uid.utid", "clientid"); Assert.AreEqual("uid.utid-login.microsoftonline.com-idtoken-clientid-contoso.com-", key.ToString()); Assert.AreEqual("uid.utid-login.microsoftonline.com", key.GetiOSAccountKey()); Assert.AreEqual("idtoken-clientid-contoso.com-", key.GetiOSServiceKey()); Assert.AreEqual("idtoken-clientid-contoso.com", key.GetiOSGenericKey()); }
public string GetIdToken(MsalIdTokenCacheKey idTokenKey) { return(_idTokenSharedPreference.GetString(idTokenKey.ToString(), null)); }
public void DeleteIdToken(MsalIdTokenCacheKey cacheKey) { _idTokenCacheDictionary.Remove(cacheKey.ToString()); }
public void DeleteIdToken(MsalIdTokenCacheKey cacheKey) { _idTokenContainer.Values.Remove(/*CoreCryptographyHelpers.CreateBase64UrlEncodedSha256Hash(cacheKey)*/ cacheKey.ToString()); }