public static void RegisterAuth() { // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter, // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166 //OAuthWebSecurity.RegisterMicrosoftClient( // clientId: "", // clientSecret: ""); //OAuthWebSecurity.RegisterTwitterClient( // consumerKey: "", // consumerSecret: ""); //OAuthWebSecurity.RegisterFacebookClient( // appId: "", // appSecret: ""); //OAuthWebSecurity.RegisterGoogleClient(); TokenRefreshCallback refreshCallback = new TokenRefreshCallback(tokenRefreshed); BulutfonWebClient client = new BulutfonWebClient( clientId: "CLIENT_ID", clientSecret: "CLIENT_SECRET", refreshCallback: refreshCallback); OAuthWebSecurity.RegisterClient(client, "Bulutfon", null); Token tkn = new Token("a", "b"); tkn.RefreshCallback += tokenRefreshed; }
protected BulutfonWebClient(string providerName, string clientId, string clientSecret, TokenRefreshCallback refreshCallback) : base(providerName) { if (string.IsNullOrWhiteSpace(clientId) || string.IsNullOrWhiteSpace(clientSecret)) throw new ArgumentNullException("client id ya da client secret belirtilmemiş!"); ClientId = clientId; ClientSecret = clientSecret; RefreshCallback = refreshCallback; }
protected BulutfonWebClient(string providerName, string clientId, string clientSecret, TokenRefreshCallback refreshCallback) : base(providerName) { if (string.IsNullOrWhiteSpace(clientId) || string.IsNullOrWhiteSpace(clientSecret)) { throw new ArgumentNullException("client id ya da client secret belirtilmemiş!"); } ClientId = clientId; ClientSecret = clientSecret; RefreshCallback = refreshCallback; }
public BulutfonWebClient(string clientId, string clientSecret, TokenRefreshCallback refreshCallback) : this("Bulutfon", clientId, clientSecret, refreshCallback) { }