public OAuth1App( string consumerKey, string consumerSecret, string callbackUrl, #if __WINDOWS__ AuthenticationInterfaceEnum browserType = AuthenticationInterfaceEnum.Dedicated, OAuthAppTypeEnum appType = OAuthAppTypeEnum.Desktop
public virtual OAuth2ResourceProvider SetFlow( string clientId, string clientSecret, AuthenticationInterfaceEnum @interface, OAuthAppTypeEnum appType) { ResponseTypeEnum flow; if (@interface == AuthenticationInterfaceEnum.Dedicated && appType == OAuthAppTypeEnum.Desktop) { flow = clientSecret != null ? ResponseTypeEnum.Code : ResponseTypeEnum.Token; } else if (@interface == AuthenticationInterfaceEnum.Embedded && appType == OAuthAppTypeEnum.Desktop) { throw new NotSupportedException( StringResources.EmbeddedDesktopUINotSupportedException); } else if (@interface == AuthenticationInterfaceEnum.Dedicated && appType == OAuthAppTypeEnum.Mobile) { flow = ResponseTypeEnum.Code; } else if (@interface == AuthenticationInterfaceEnum.Embedded && appType == OAuthAppTypeEnum.Mobile) { flow = clientSecret != null ? ResponseTypeEnum.Code : ResponseTypeEnum.Token; } else { throw new NotSupportedException(); } if (!Flows.Contains(flow)) { throw new InvalidGrantTypeException( string.Format( StringResources.GrantTypeNotSupportedException, GetType().Name)); } Flow = flow; return(this); }
public OAuth1AppBase( string consumerKey, string consumerSecret, string callbackUrl, IOAuthAuthorizerUIFactory uiFactory, TResourceProvider provider, AuthenticationInterfaceEnum browserType, OAuthAppTypeEnum appType) { _consumerKey = consumerKey; _consumerSecret = consumerSecret; _callbackUrl = callbackUrl; _uiFactory = uiFactory; _provider = provider; _browserType = browserType; _appType = appType; }
public OAuth2AppBase( string clientId, string callbackUrl, IOAuthAuthorizerUIFactory uiFactory, TResourceProvider provider, AuthenticationInterfaceEnum browserType, OAuthAppTypeEnum appType) : this( clientId, null, callbackUrl, uiFactory, provider, browserType, appType) { }
public OAuth2AppBase( string clientId, string clientSecret, string callbackUrl, IOAuthAuthorizerUIFactory uiFactory, TResourceProvider provider, AuthenticationInterfaceEnum browserType, OAuthAppTypeEnum appType) { _clientId = clientId; _clientSecret = clientSecret; _callbackUrl = callbackUrl; _browserType = browserType; _uiFactory = uiFactory; _provider = provider; provider.SetFlow( clientId, clientSecret, browserType, appType); }