GetAuthorizationUrl() public method

Creates an authorization url that can be used to authorize access to a user's account.
public GetAuthorizationUrl ( OAuth2ResponseType oAuth2ResponseType, string state = null ) : string
oAuth2ResponseType OAuth2ResponseType Determines if Imgur returns a Code, a PIN code, or an opaque Token.
state string /// This optional parameter indicates any state which may be useful to your application upon receipt of /// the response. ///
return string
示例#1
0
 public void GetAuthorizationUrl_SetStateNull_AreEqual()
 {
     var client = new ImgurClient("xyz", "deb");
     var endpoint = new OAuth2Endpoint(client);
     var expected = "https://api.imgur.com/oauth2/authorize?client_id=xyz&response_type=Code&state=";
     Assert.AreEqual(expected, endpoint.GetAuthorizationUrl(OAuth2ResponseType.Code, null));
 }
示例#2
0
 public void GetAuthorizationUrl_SetState_AreEqual()
 {
     var client = new ImgurClient("abc", "ioa");
     var endpoint = new OAuth2Endpoint(client);
     var expected = "https://api.imgur.com/oauth2/authorize?client_id=abc&response_type=Code&state=test";
     Assert.AreEqual(expected, endpoint.GetAuthorizationUrl(OAuth2ResponseType.Code, "test"));
 }