Пример #1
0
        public string PrepareAuthRequest(PrepareAuthenticationContext context)
        {
            var authorization =
                googleConsumer.ProcessUserAuthorization();

            var callback =
                new Uri(Utils.GetUrlBase(context.Request) + context.RedirectPath);

            if (authorization == null)
            {
                return
                    (googleConsumer
                     .PrepareRequestUserAuthorization(returnTo: callback,
                                                      scopes:
                                                      new[] { "https://www.googleapis.com/auth/userinfo.profile" })
                     .Headers["Location"]);
            }

            return(null);
        }