Beispiel #1
0
        public override string GetAuthenticationUrl(string lang)
        {
            var query = QueryStringBuilder.BuildCompex(new[] { "scope" },
                                                       "scope", _clientProvider.Scope,
                                                       "redirect_uri", _clientProvider.CallBackUrl,
                                                       "client_id", _clientProvider.ClientId,
                                                       "response_type", "code",
                                                       "approval_prompt", "force", //auto
                                                                                   //"prompt", "select_account", //https://stackoverflow.com/questions/14384354/force-google-account-chooser
                                                       "access_type", "online",
                                                       "hl", lang
                                                       );

            return("https://accounts.google.com/o/oauth2/auth?" + query);
        }
Beispiel #2
0
        public override string BeginAuthentication()
        {
            var qstring = QueryStringBuilder.BuildCompex(new[] { "scope" },
                                                         "scope", _client.Scope,
                                                         "state", "1",
                                                         "redirect_uri", _client.CallBackUrl,
                                                         "client_id", _client.ClientId,
                                                         "response_type", "code",
                                                         "approval_prompt", "auto",
                                                         "access_type", "online"
                                                         );

            _oauthUrl = "https://accounts.google.com/o/oauth2/auth?" + qstring;

            return(_oauthUrl);
        }