예제 #1
0
        public void SaveRefreshToken(string cacheKey, string item)
        {
            ApplicationDataCompositeValue composite = new ApplicationDataCompositeValue();

            SetCacheValue(composite, item);
            _refreshTokenContainer.Values[CryptographyHelper.CreateBase64UrlEncodedSha256Hash(cacheKey)] = composite;
        }
예제 #2
0
        /// <summary>
        /// Constructor to create credential with assertion and assertionType
        /// </summary>
        /// <param name="assertion">Assertion representing the user.</param>
        /// <param name="assertionType">Type of the assertion representing the user.</param>
        public UserAssertion(string assertion, string assertionType)
        {
            if (string.IsNullOrWhiteSpace(assertion))
            {
                throw new ArgumentNullException(nameof(assertion));
            }

            if (string.IsNullOrWhiteSpace(assertionType))
            {
                throw new ArgumentNullException(nameof(assertionType));
            }

            AssertionType = assertionType;
            Assertion     = assertion;
            AssertionHash =
                CryptographyHelper.CreateBase64UrlEncodedSha256Hash(Assertion);
        }
예제 #3
0
 public void DeleteRefreshToken(string cacheKey)
 {
     _refreshTokenContainer.Values.Remove(CryptographyHelper.CreateBase64UrlEncodedSha256Hash(cacheKey));
 }
예제 #4
0
 public string GetRefreshToken(string refreshTokenKey)
 {
     return(MsalHelpers.ByteArrayToString(
                GetCacheValue((ApplicationDataCompositeValue)_refreshTokenContainer.Values[
                                  CryptographyHelper.CreateBase64UrlEncodedSha256Hash(refreshTokenKey)])));
 }