コード例 #1
0
        protected string ExtractSignedAuthorization(Microsoft.Cis.Services.Nephos.Common.RequestContext requestContext)
        {
            string authorizationScheme;
            string authorizationSchemeParameters;

            try
            {
                authorizationScheme           = requestContext.AuthorizationScheme;
                authorizationSchemeParameters = requestContext.AuthorizationSchemeParameters;
            }
            catch (HttpRequestHeaderNotFoundException httpRequestHeaderNotFoundException)
            {
                throw new AuthenticationFailureException("Authorization header not found", httpRequestHeaderNotFoundException);
            }
            catch (HttpRequestInvalidHeaderException httpRequestInvalidHeaderException1)
            {
                HttpRequestInvalidHeaderException httpRequestInvalidHeaderException = httpRequestInvalidHeaderException1;
                throw new InvalidAuthenticationInfoException(httpRequestInvalidHeaderException.Message, httpRequestInvalidHeaderException);
            }
            catch (HttpRequestDuplicateHeaderException httpRequestDuplicateHeaderException)
            {
                throw new InvalidAuthenticationInfoException("Duplicate authorization headers found");
            }
            if (string.IsNullOrEmpty(authorizationSchemeParameters) || string.IsNullOrEmpty(authorizationScheme) || !authorizationScheme.Equals("SignedKey"))
            {
                throw new AuthenticationFailureException(string.Concat("SignedKey scheme expected but found ", authorizationScheme));
            }
            return(authorizationSchemeParameters);
        }
コード例 #2
0
 public SignedAccessHelper(Microsoft.Cis.Services.Nephos.Common.RequestContext requestContext, NephosUriComponents uriComponents)
 {
     NephosAssertionException.Assert(requestContext != null);
     NephosAssertionException.Assert(uriComponents != null);
     NephosAssertionException.Assert(requestContext.QueryParameters != null);
     this.QueryParams    = requestContext.QueryParameters;
     this.RequestContext = requestContext;
     this.UriComponents  = uriComponents;
     this.SignedProtocol = SasProtocol.All;
 }
コード例 #3
0
 public AuthenticationInformation(string authScheme, SupportedAuthScheme originalRequestAuthScheme, Collection <AuthDataEntry> authData, Microsoft.Cis.Services.Nephos.Common.RequestContext requestContext, NephosUriComponents uriComponents, bool isInterStampAuthentication)
 {
     this.authScheme     = authScheme;
     this.authData       = authData;
     this.requestContext = requestContext;
     this.uriComponents  = uriComponents;
     this.authKeyName    = null;
     if (originalRequestAuthScheme == SupportedAuthScheme.SignedKey && requestContext.QueryParameters["sv"] != null)
     {
         this.authKeyName = AuthenticationManagerHelper.ExtractKeyNameFromParamsWithConversion(requestContext.QueryParameters);
         if (this.authKeyName != null)
         {
             Logger <IRestProtocolHeadLogger> .Instance.Verbose.Log("Using secret key with KeyName '{0}' to authenticate SAS/DSAS.", new object[] { this.authKeyName });
         }
     }
 }
コード例 #4
0
 public TableSignedAccessHelper(Microsoft.Cis.Services.Nephos.Common.RequestContext requestContext, NephosUriComponents uriComponents) : base(requestContext, uriComponents)
 {
 }
コード例 #5
0
 public void JustDecompileGenerated_set_RequestContext(Microsoft.Cis.Services.Nephos.Common.RequestContext value)
 {
     this.RequestContext = value;
 }
コード例 #6
0
 public AccountSasHelper(Microsoft.Cis.Services.Nephos.Common.RequestContext requestContext, NephosUriComponents uriComponents) : base(requestContext, uriComponents)
 {
     this.SignedService      = SasService.None;
     this.SignedResourceType = SasResourceType.None;
 }
コード例 #7
0
 public BlobSignedAccessHelper(Microsoft.Cis.Services.Nephos.Common.RequestContext requestContext, NephosUriComponents uriComponents) : base(requestContext, uriComponents)
 {
     this.SignedResource = SASAccessLevel.None;
 }