コード例 #1
0
        public SideKickOAuthImplementation()
        {
            AuthorizeEndpointPath       = new PathString("/oauth/authorize");
            TokenEndpointPath           = new PathString("/oauth/token");
            ApplicationCanDisplayErrors = true;
            AllowInsecureHttp           = true;
            Provider = new SidekickOAuthProvider();


            AuthorizationCodeProvider = new AuthenticationTokenProvider
            {
                OnCreate  = CreateAuthenticationCode,
                OnReceive = ReceiveAuthenticationCode,
            };

            RefreshTokenProvider = new AuthenticationTokenProvider
            {
                OnCreate  = CreateRefreshToken,
                OnReceive = ReceiveRefreshToken,
            };

            // AccessTokenExpireTimeSpan = TimeSpan.FromHours(1); //modify during production..you might wanna read from db

            AccessTokenFormat = new SidekickJwtFormat(this);
        }
コード例 #2
0
        public SideKickOAuthImplementation()
        {
            AuthorizeEndpointPath = new PathString("/oauth/authorize");
            TokenEndpointPath = new PathString("/oauth/token");
            ApplicationCanDisplayErrors = true;
            AllowInsecureHttp = true;
            Provider = new SidekickOAuthProvider();

            AuthorizationCodeProvider = new AuthenticationTokenProvider
                                        {
                                            OnCreate = CreateAuthenticationCode,
                                            OnReceive = ReceiveAuthenticationCode,
                                        };

            RefreshTokenProvider = new AuthenticationTokenProvider
                                   {
                                       OnCreate = CreateRefreshToken,
                                       OnReceive = ReceiveRefreshToken,
                                   };

            AccessTokenExpireTimeSpan = TimeSpan.FromHours(1); //modify during production..you might wanna read from db

            AccessTokenFormat = new SidekickJwtFormat(this);
        }