/// <summary>
        /// Called prior to the OIDC middleware redirecting to the authentication endpoint.  In the event we are signing up a tenant, we need to
        /// put the "admin_consent" value for the prompt query string parameter.  AAD uses this to show the admin consent flow.
        /// </summary>
        /// <param name="context">The <see cref="Microsoft.AspNet.Authentication.OpenIdConnect.RedirectContext"/> for this event.</param>
        /// <returns>A completed <see cref="System.Threading.Tasks.Task"/></returns>
        public override Task RedirectToAuthenticationEndpoint(RedirectContext context)
        {
            if (context.IsSigningUp())
            {
                context.ProtocolMessage.Prompt = "admin_consent";
            }

            _logger.RedirectToIdentityProvider();
            return Task.FromResult(0);
        }
        internal static Task RedirectToAuthenticationEndpoint(RedirectContext context)
        {
            eventsFired.Add(nameof(RedirectToAuthenticationEndpoint));

            if (context.ProtocolMessage.RequestType == OpenIdConnectRequestType.LogoutRequest)
            {
                context.ProtocolMessage.PostLogoutRedirectUri =
                    context.Request.Scheme + "://" + context.Request.Host + context.Request.PathBase + new PathString("/Account/Login");
            }

            return Task.FromResult(0);
        }
Пример #3
0
 public virtual Task RedirectToEndSessionEndpoint(RedirectContext context) => OnRedirectToEndSessionEndpoint(context);
Пример #4
0
 public virtual Task RedirectToAuthenticationEndpoint(RedirectContext context) => OnRedirectToAuthenticationEndpoint(context);
 public override Task RedirectToEndSessionEndpoint(RedirectContext context)
 {
     return base.RedirectToEndSessionEndpoint(context);
 }