Пример #1
0
        public string PrepareAuthRequest(PrepareAuthenticationContext context)
        {
            var callback = new Uri(Utils.GetUrlBase(context.RequestUri) + context.RedirectPath);

            var consumer = new TwitterConsumer(context.SessionStorage);
            return consumer
                .StartSignInWithTwitter(callback)
                .Headers["Location"];
        }
Пример #2
0
        public string PrepareAuthRequest(PrepareAuthenticationContext context)
        {
            var callback =
                new Uri(Utils.GetUrlBase(context.Request) + context.RedirectPath);

            var consumer = new TwitterConsumer(context.SessionStorage);

            return(consumer
                   .StartSignInWithTwitter(callback)
                   .Headers["Location"]);
        }
Пример #3
0
        public string PrepareAuthRequest(PrepareAuthenticationContext context)
        {
            var authorization = facebookConsumer.ProcessUserAuthorization();

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

            if (authorization == null)
            {
                return facebookConsumer
                        .PrepareRequestUserAuthorization(returnTo: callback)
                        .Headers["Location"];
            }

            return null;
        }
Пример #4
0
        public string PrepareAuthRequest(PrepareAuthenticationContext context)
        {
            var authorization =
                facebookConsumer.ProcessUserAuthorization();

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

            if (authorization == null)
            {
                return
                    (facebookConsumer
                     .PrepareRequestUserAuthorization(returnTo: callback)
                     .Headers["Location"]);
            }

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

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

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

            return null;
        }
Пример #6
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);
        }