Orchard CMS OAuth 2 Server Custom Module

Jun 21 at 5:03 AM
Edited Jun 21 at 5:03 AM
I was Tried to create a OAuth Server 2 for Signle Sign on for Communicate one client Application using IOwinMiddlewareProvider and add OwinMiddlewareRegistration
 new OwinMiddlewareRegistration {
                    Priority = "1",

                    Configure = app => {

                     
                        var oAuthOptions = new OAuthAuthorizationServerOptions {
                            TokenEndpointPath = new PathString(Paths.TokenPath),
                            AuthorizeEndpointPath = new PathString(Paths.AuthorizePath),
                            Provider = new OAuthServerProvider(_clientRepository, _workContextAccessor), 
                            ApplicationCanDisplayErrors = true,
                            AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),
                            AllowInsecureHttp = true,
                            AuthenticationMode = AuthenticationMode.Passive,




                            AuthorizationCodeProvider = new AuthenticationTokenProvider
                            {
                                OnCreate = CreateAuthenticationCode,
                                OnReceive = ReceiveAuthenticationCode,
}
The AuthorizationCodeProvider AuthorizeEndpointPath for SSO not Working. but TokenEndpointPath was working in Web API. How to Create a OAuth Server Provider in Orchard.