RadCloudLogin allows you to bypass the default Social Login Provider logic and acquire a corresponding access manually. This includes manually opening a corresponding
login page in a web browser, requesting the user for permissions and reading the access token from the server response. The following step-by-step guide will explain how to setup an infrastructure
to manually acquire an access token from an OAuth 2.0 social login provider.
|A manual Access Token retrieval procedure will bypass the automated one.|
- Define the login providers in your RadCloudLogin instance as described in the Getting started section.
Use the SocialLoginTokenProvider property to define a callback which will be used by RadCloudLogin to read the
already acquired access token. This method is internally awaited so that you can easily make asynchronous requests to the remote OAuth 2.0 service provider. The following code
sample demonstrates how to do this:
public partial class LoginPage : PhoneApplicationPage
TaskCompletionSource<string> csource = new TaskCompletionSource<string>();
this.cloudLogin.SocialLoginTokenProvider = this.GetAccessToken;
private async Task<string> GetAccessToken(LoginProvider chosenProvider)
string response = await this.OpenBrowser("<oauth-provider-uri>");
string accessToken = await this.AcquireAccessToken(response);
private Task<string> OpenBrowser(string uri)
private Task AcquireAccessToken(string codeResponse)
The LoginProvider parameter is used to identify which of the available login providers has been chosen by your user. The method returns a string representing
the acquired access token. If the return value is null or an empty string no login attempt is made with the initialized Cloud Provider.
If the Access Token retrieval is unsuccessful, you can return null or an empty string and RadCloudLogin will bypass the login procedure.