_ExternalLoginsListPartial.cshtml 1.2 KB

1234567891011121314151617181920212223242526272829
  1. @model Winsoft.GOV.XF.WX.Models.ExternalLoginListViewModel
  2. @using Microsoft.Owin.Security
  3. <h4>使用其他服务登录。</h4>
  4. <hr />
  5. @{
  6. var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes();
  7. if (loginProviders.Count() == 0) {
  8. <div>
  9. <p>
  10. There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkId=403804">this article</a>
  11. for details on setting up this ASP.NET application to support logging in via external services.
  12. </p>
  13. </div>
  14. }
  15. else {
  16. using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Model.ReturnUrl })) {
  17. @Html.AntiForgeryToken()
  18. <div id="socialLoginList">
  19. <p>
  20. @foreach (AuthenticationDescription p in loginProviders) {
  21. <button type="submit" class="btn btn-default" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="使用你的 @p.Caption 帐户登录">@p.AuthenticationType</button>
  22. }
  23. </p>
  24. </div>
  25. }
  26. }
  27. }