示例#1
0
 /// <summary>
 /// Redirects current client to the authorization page of the specified provider and return URL.
 /// </summary>
 /// <param name="clientName">Provider name, through which it is necessary to authorize the current user.</param>
 /// <param name="returnUrl">The address to which the user is redirected after the authorization.</param>
 /// <param name="state">Custom state associated with authorization request.</param>
 /// <exception cref="ClientIsNotRegisteredException">
 /// <paramref name="clientName"/> is unregistered. Use the <see cref="OAuthManager.RegisterClient(OAuthBase)" /> for OAuth clients registration.
 /// </exception>
 /// <exception cref="NullHttpContextException">
 /// The exception that is thrown when you try to access methods that are designed for web projects.
 /// </exception>
 /// <remarks>
 /// <para>The method will not work in desktop applications. For desktop applications you can use <see cref="GetAuthorizationUrl(string, string)"/>.</para>
 /// </remarks>
 /// <seealso cref="GetAuthorizationUrl(string, string, object)"/>
 public static void RedirectToAuthorization(string clientName, string returnUrl, object state)
 {
     OAuthWeb.RedirectToAuthorization(ClientName.Parse(clientName), null, returnUrl, state);
 }
示例#2
0
 /// <summary>
 /// Redirects current client to the authorization page of the specified provider, query parameters and return URL.
 /// </summary>
 /// <param name="clientName">Provider name, through which it is necessary to authorize the current user.</param>
 /// <param name="returnUrl">The address to which the user is redirected after the authorization.</param>
 /// <param name="parameters">Additional parameters to be passed to the authorization query.</param>
 /// <exception cref="ClientIsNotRegisteredException">
 /// <paramref name="clientName"/> is unregistered. Use the <see cref="OAuthManager.RegisterClient(OAuthBase)" /> for OAuth clients registration.
 /// </exception>
 /// <exception cref="NullHttpContextException">
 /// The exception that is thrown when you try to access methods that are designed for web projects.
 /// </exception>
 /// <remarks>
 /// <para>The method will not work in desktop applications. For desktop applications you can use <see cref="GetAuthorizationUrl(string, NameValueCollection, string)"/>.</para>
 /// </remarks>
 /// <seealso cref="GetAuthorizationUrl(ClientName, NameValueCollection, string)"/>
 public static void RedirectToAuthorization(ClientName clientName, NameValueCollection parameters, string returnUrl)
 {
     OAuthWeb.RedirectToAuthorization(clientName, parameters, returnUrl, null);
 }
示例#3
0
 /// <summary>
 /// Redirects current client to the authorization page of the specified provider with specified parameters.
 /// </summary>
 /// <param name="clientName">Provider name, through which it is necessary to authorize the current user.</param>
 /// <param name="parameters">Additional parameters to be passed to the authorization query.</param>
 /// <exception cref="ClientIsNotRegisteredException">
 /// <paramref name="clientName"/> is unregistered. Use the <see cref="OAuthManager.RegisterClient(OAuthBase)" /> for OAuth clients registration.
 /// </exception>
 /// <exception cref="NullHttpContextException">
 /// The exception that is thrown when you try to access methods that are designed for web projects.
 /// </exception>
 /// <remarks>
 /// <para>The method will not work in desktop applications. For desktop applications you can use <see cref="GetAuthorizationUrl(string, NameValueCollection)"/>.</para>
 /// </remarks>
 /// <seealso cref="GetAuthorizationUrl(string, NameValueCollection)"/>
 public static void RedirectToAuthorization(string clientName, NameValueCollection parameters)
 {
     OAuthWeb.RedirectToAuthorization(ClientName.Parse(clientName), parameters, null, null);
 }
示例#4
0
 /// <summary>
 /// Redirects current client to the authorization page of the specified provider.
 /// </summary>
 /// <param name="clientName">Provider name, through which it is necessary to authorize the current user.</param>
 /// <exception cref="ClientIsNotRegisteredException">
 /// <paramref name="clientName"/> is unregistered. Use the <see cref="OAuthManager.RegisterClient(OAuthBase)" /> for OAuth clients registration.
 /// </exception>
 /// <exception cref="NullHttpContextException">
 /// The exception that is thrown when you try to access methods that are designed for web projects.
 /// </exception>
 /// <remarks>
 /// <para>The method will not work in desktop applications. For desktop applications you can use <see cref="GetAuthorizationUrl(string)"/>.</para>
 /// </remarks>
 /// <seealso cref="GetAuthorizationUrl(string)"/>
 public static void RedirectToAuthorization(string clientName)
 {
     OAuthWeb.RedirectToAuthorization(ClientName.Parse(clientName), null, null, null);
 }
示例#5
0
 /// <summary>
 /// Redirects current client to the authorization page of the specified provider and return URL.
 /// </summary>
 /// <param name="providerName">Provider name, through which it is necessary to authorize the current user.</param>
 /// <param name="returnUrl">The address to which the user is redirected after the authorization.</param>
 /// <exception cref="ClientIsNotRegisteredException">
 /// <paramref name="providerName"/> is unregistered. Use the <see cref="OAuthManager.RegisterClient(OAuthBase)" /> for OAuth clients registration.
 /// </exception>
 /// <exception cref="NullHttpContextException">
 /// The exception that is thrown when you try to access methods that are designed for web projects.
 /// </exception>
 /// <remarks>
 /// <para>The method will not work in desktop applications. For desktop applications you can use <see cref="GetAuthorizationUrl(string, string)"/>.</para>
 /// </remarks>
 /// <seealso cref="GetAuthorizationUrl(string, string)"/>
 public static void RedirectToAuthorization(string providerName, string returnUrl)
 {
     OAuthWeb.RedirectToAuthorization(providerName, null, returnUrl);
 }
示例#6
0
 /// <summary>
 /// Redirects current client to the authorization page of the specified provider with specified parameters.
 /// </summary>
 /// <param name="providerName">Provider name, through which it is necessary to authorize the current user.</param>
 /// <param name="parameters">Additional parameters to be passed to the authorization query.</param>
 /// <exception cref="ClientIsNotRegisteredException">
 /// <paramref name="providerName"/> is unregistered. Use the <see cref="OAuthManager.RegisterClient(OAuthBase)" /> for OAuth clients registration.
 /// </exception>
 /// <exception cref="NullHttpContextException">
 /// The exception that is thrown when you try to access methods that are designed for web projects.
 /// </exception>
 /// <remarks>
 /// <para>The method will not work in desktop applications. For desktop applications you can use <see cref="GetAuthorizationUrl(string, NameValueCollection)"/>.</para>
 /// </remarks>
 /// <seealso cref="GetAuthorizationUrl(string, NameValueCollection)"/>
 public static void RedirectToAuthorization(string providerName, NameValueCollection parameters)
 {
     OAuthWeb.RedirectToAuthorization(providerName, parameters, null);
 }
示例#7
0
 /// <summary>
 /// Redirects current client to the authorization page of the specified provider.
 /// </summary>
 /// <param name="providerName">Provider name, through which it is necessary to authorize the current user.</param>
 /// <exception cref="ClientIsNotRegisteredException">
 /// <paramref name="providerName"/> is unregistered. Use the <see cref="OAuthManager.RegisterClient(OAuthBase)" /> for OAuth clients registration.
 /// </exception>
 /// <exception cref="NullHttpContextException">
 /// The exception that is thrown when you try to access methods that are designed for web projects.
 /// </exception>
 /// <remarks>
 /// <para>The method will not work in desktop applications. For desktop applications you can use <see cref="GetAuthorizationUrl(string)"/>.</para>
 /// </remarks>
 /// <seealso cref="GetAuthorizationUrl(string)"/>
 public static void RedirectToAuthorization(string providerName)
 {
     OAuthWeb.RedirectToAuthorization(providerName, null, null);
 }