首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在MVC中的OpenID-Connect中执行重定向前的操作

如何在MVC中的OpenID-Connect中执行重定向前的操作
EN

Stack Overflow用户
提问于 2020-02-03 19:52:54
回答 1查看 80关注 0票数 0

我已经试了好几天了,但是不能弄明白,如果有人能帮到我,我将不胜感激。

代码语言:javascript
复制
public void SignIn()
        {
            // Send an OpenID Connect sign-in request.
            if (!Request.IsAuthenticated)
            {

                //Perform some action if user is successfully authenticated??

                HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = "https://localhost:44309/DummyController/DummyAction" }, OpenIdConnectAuthenticationDefaults.AuthenticationType);
            }

        }
EN

回答 1

Stack Overflow用户

发布于 2020-12-17 01:22:48

实现动作RedirectToIdentityProvider

代码语言:javascript
复制
  Notifications = new OpenIdConnectAuthenticationNotifications
            {
                RedirectToIdentityProvider = OnRedirectToIdentityProvider
            }

   private Task OnRedirectToIdentityProvider(RedirectToIdentityProviderNotification<OpenIdConnectMessage, 
        OpenIdConnectAuthenticationOptions> arg)
    {
        throw new NotImplementedException();
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60038734

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档