Exemplo n.º 1
0
        private static void SetSignProvider(OAuthRequestContext context)
        {
            ISignProvider signingProvider = SignProviders.GetProvider(context.Parameters.SignatureMethod);

            if (signingProvider == null)
            {
                // There is no signing provider for this signature method
                throw new OAuthRequestException(null, OAuthProblemTypes.SignatureMethodRejected);
            }

            // Double check the signing provider declares that it can handle the signature method
            if (!signingProvider.SignatureMethod.Equals(context.Parameters.SignatureMethod))
            {
                throw new OAuthRequestException(null, OAuthProblemTypes.SignatureMethodRejected);
            }

            context.SignProvider = signingProvider;
        }
Exemplo n.º 2
0
 public ISignProvider GetSignProvider(string signatureMethod)
 {
     //TODO: make it configurable ...
     return(SignProviders.GetProvider(signatureMethod));
 }