当前位置: 首页>>代码示例>>C#>>正文


C# IOAuthContext类代码示例

本文整理汇总了C#中IOAuthContext的典型用法代码示例。如果您正苦于以下问题:C# IOAuthContext类的具体用法?C# IOAuthContext怎么用?C# IOAuthContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IOAuthContext类属于命名空间,在下文中一共展示了IOAuthContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AssertContextDoesNotIncludeToken

 void AssertContextDoesNotIncludeToken(IOAuthContext context)
 {
   if (context.Token != null)
   {
     throw Error.RequestForTokenMustNotIncludeTokenInContext(context);
   }
 }
开发者ID:tiwariritesh7,项目名称:devdefined-tools,代码行数:7,代码来源:OAuthProvider.cs

示例2: ConsumerRequest

 public ConsumerRequest(IOAuthSession oauthSession, IOAuthContext context, IOAuthConsumerContext consumerContext, ICertificateFactory clientSslCertificateFactory)
 {
     _oauthSession = oauthSession;
     _context = context;
     _consumerContext = consumerContext;
     _clientSslCertificateFactory = clientSslCertificateFactory;
 }
开发者ID:sgtfsu,项目名称:XeroAPI.Net,代码行数:7,代码来源:ConsumerRequest.cs

示例3: InspectRequest

 protected virtual void InspectRequest(IOAuthContext context)
 {
     foreach (IContextInspector inspector in _inspectors)
     {
         inspector.InspectContext(context);
     }
 }
开发者ID:patrickleet,项目名称:oauth-mvc.net,代码行数:7,代码来源:OAuthProvider.cs

示例4: SignContextWithToken

    public void SignContextWithToken(IOAuthContext context, IToken token)
    {
      context.Token = token.Token;
      context.TokenSecret = token.TokenSecret;

      SignContext(context);
    }
开发者ID:tiwariritesh7,项目名称:devdefined-tools,代码行数:7,代码来源:OAuthConsumerContext.cs

示例5: InspectContext

    public void InspectContext(ProviderPhase phase, IOAuthContext context)
    {
      if (phase != ProviderPhase.CreateAccessToken) {
        return;
      }

      var authMode = context.XAuthMode;
      if (string.IsNullOrEmpty(authMode)) {
        throw Error.EmptyXAuthMode(context);
      }

      if (!_validateModeFunc(authMode)) {
        throw Error.InvalidXAuthMode(context);
      }

      var username = context.XAuthUsername;
      if (string.IsNullOrEmpty(username)) {
        throw Error.EmptyXAuthUsername(context);
      }

      var password = context.XAuthPassword;
      if (string.IsNullOrEmpty(password)) {
        throw Error.EmptyXAuthPassword(context);
      }

      if (!_authenticateFunc(username, password)) {
        throw Error.FailedXAuthAuthentication(context);
      }
    }
开发者ID:yonglehou,项目名称:DevDefined.OAuth,代码行数:29,代码来源:XAuthValidationInspector.cs

示例6: InspectContext

		public void InspectContext(ProviderPhase phase, IOAuthContext context)
		{
			if (!_nonceStore.RecordNonceAndCheckIsUnique(context, context.Nonce))
			{
				throw Error.NonceHasAlreadyBeenUsed(context);
			}
		}
开发者ID:yonglehou,项目名称:DevDefined.OAuth,代码行数:7,代码来源:NonceStoreInspector.cs

示例7: CreateConsumerRequest

 public IConsumerRequest CreateConsumerRequest(IOAuthContext context, IOAuthConsumerContext consumerContext, IToken token)
 {
 	if (context == null) throw new ArgumentNullException("context");
 	if (consumerContext == null) throw new ArgumentNullException("consumerContext");
 	
 	return new ConsumerRequest(context, consumerContext, token);
 }
开发者ID:javicrespo,项目名称:DevDefined.OAuth,代码行数:7,代码来源:DefaultConsumerRequestFactory.cs

示例8: GetStatusOfRequestForAccess

    public RequestForAccessStatus GetStatusOfRequestForAccess(IOAuthContext requestContext)
    {
      if (requestContext.ConsumerKey == "key" && requestContext.Token == "requestkey")
        return RequestForAccessStatus.Granted;

      return RequestForAccessStatus.Unknown;
    }
开发者ID:vincentpaca,项目名称:DevDefined.OAuth,代码行数:7,代码来源:TestTokenStore.cs

示例9: ValidateCallbackUrlIsPartOfRequest

		static void ValidateCallbackUrlIsPartOfRequest(IOAuthContext context)
		{
			if (string.IsNullOrEmpty(context.CallbackUrl))
			{
				throw Error.MissingRequiredOAuthParameter(context, Parameters.OAuth_Callback);
			}
		}
开发者ID:yonglehou,项目名称:DevDefined.OAuth,代码行数:7,代码来源:OAuth10aInspector.cs

示例10: InspectContext

 public void InspectContext(IOAuthContext context)
 {
     if (!_consumerStore.IsConsumer(context))
     {
         throw Error.UnknownConsumerKey(context);
     }
 }
开发者ID:JhonatanSteven,项目名称:oauth-mvc.net,代码行数:7,代码来源:ConsumerValidationInspector.cs

示例11: ConsumerRequest

 public ConsumerRequest(IOAuthContext context, IOAuthConsumerContext consumerContext, IToken token, ICertificateFactory clientSslCertificateFactory)
 {
     _context = context;
     _consumerContext = consumerContext;
     _token = token;
     _clientSslCertificateFactory = clientSslCertificateFactory;
 }
开发者ID:vincentpaca,项目名称:DevDefined.OAuth,代码行数:7,代码来源:ConsumerRequest.cs

示例12: AuthenticateClient

		public bool AuthenticateClient(IOAuthContext context)
		{
			Client actual = ClientRepo.FindClient(context.Client.ClientId);
			if (actual == null) return false;

			return actual.ClientSecret == context.Client.ClientSecret;
		}
开发者ID:ghorsey,项目名称:SharpOAuth2,代码行数:7,代码来源:ClientService.cs

示例13: OAuthException

 public OAuthException(IConsumerResponse consumerResponse, IOAuthContext requestContext, OAuthProblemReport problemReport)
     : base(problemReport.ProblemAdvice)
 {
     ConsumerResponse = consumerResponse;
     Report = problemReport;
     Context = requestContext;
 }
开发者ID:Bitwix,项目名称:XeroAPI.Net,代码行数:7,代码来源:OAuthException.cs

示例14: ConsumerRequest

		public ConsumerRequest(IOAuthContext context, IOAuthConsumerContext consumerContext, IToken token)
		{
			if (context == null) throw new ArgumentNullException("context");
			if (consumerContext == null) throw new ArgumentNullException("consumerContext");
			_context = context;
			_consumerContext = consumerContext;
			_token = token;
		}
开发者ID:maksymilian-majer,项目名称:DevDefined.OAuth,代码行数:8,代码来源:ConsumerRequest.cs

示例15: ConsumeRequestToken

    public void ConsumeRequestToken(IOAuthContext requestContext)
    {
      EnsureTestConsumer(requestContext);

      if (requestContext.Token != "requestkey")
        throw new OAuthException(requestContext, OAuthProblems.TokenRejected,
                                 "The supplied request token is unknown to the provider.");
    }
开发者ID:vincentpaca,项目名称:DevDefined.OAuth,代码行数:8,代码来源:TestTokenStore.cs


注:本文中的IOAuthContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。