2017-04-27 69 views
10

我已經建立opeiddict作爲獨立的Web應用程序作爲授權服務器。我陷入了一個小問題,那就是如何通過客戶端Web應用程序的鏈接直接進入用戶註冊頁面。現在我可以去登錄頁面,作爲你的示例:如何到達openiddict授權服務器的註冊頁面?

public ActionResult SignIn() { 
      // Instruct the OIDC client middleware to redirect the user agent to the identity provider. 
      // Note: the authenticationType parameter must match the value configured in Startup.cs 
      return new ChallengeResult(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties { 
       RedirectUri = "/" 
      }); 
     } 

有沒有辦法去認證服務器帳戶/註冊從客戶端應用程序?

+0

賽義德,Zafrul,請讓我知道如果你需要更多的東西在響應/應答的方式。 –

回答

3

它看起來像你可以在重定向設置網址。請參見下面的代碼片段:

[AllowAnonymous] 
public IActionResult SignIn() 
{ 
    return new ChallengeResult(
     OpenIdConnectDefaults.AuthenticationScheme, 
     new AuthenticationProperties 
     { 
      IsPersistent = true, 
      RedirectUri = Url.Action("SignInCallback", "Account") 
     }); 
} 

請參閱該文檔在這裏:Initiating the authentication flow