internal OpenIdConnectValidateClientRedirectUriContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectMessage authorizationRequest)
     : base(context, options, authorizationRequest)
 {
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new instance of the <see cref="HandleCryptographyRequestContext"/> class.
 /// </summary>
 public HandleCryptographyRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request)
     : base(context, options, request)
 {
     Validate();
 }
Beispiel #3
0
 /// <summary>
 /// Creates a new instance of the <see cref="ValidateAuthorizationRequestContext"/> class.
 /// </summary>
 public ValidateAuthorizationRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request)
     : base(context, options, request)
 {
     RedirectUri = request.RedirectUri;
 }
 /// <summary>
 /// Creates a new instance of the <see cref="ValidateConfigurationRequestContext"/> class.
 /// </summary>
 public ValidateConfigurationRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request)
     : base(context, options, request)
 {
     Validate();
 }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtractUserinfoRequestContext"/> class.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="options"></param>
 /// <param name="request"></param>
 public ExtractUserinfoRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request)
     : base(context, options, request)
 {
     Validate();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GrantCustomExtensionContext"/> class
 /// </summary>
 /// <param name="context"></param>
 /// <param name="options"></param>
 /// <param name="request"></param>
 public GrantCustomExtensionContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectMessage request)
     : base(context, options, null)
 {
     Request = request;
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtractLogoutRequestContext"/> class.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="options"></param>
 /// <param name="request"></param>
 public ExtractLogoutRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectMessage request)
     : base(context, options)
 {
     Request = request;
     Validate();
 }
 /// <summary>
 /// Creates an instance of this context.
 /// </summary>
 public HandleCryptographyRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectMessage request)
     : base(context, options)
 {
     Request = request;
     Validate();
 }
Beispiel #9
0
 /// <summary>
 /// Creates a new instance of the <see cref="SerializeAccessTokenContext"/> class.
 /// </summary>
 public SerializeAccessTokenContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request,
     OpenIdConnectResponse response,
     AuthenticationTicket ticket)
     : base(context, options, request, response, ticket)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HandleTokenRequestContext"/> class
 /// </summary>
 /// <param name="context"></param>
 /// <param name="options"></param>
 /// <param name="request"></param>
 /// <param name="ticket"></param>
 public HandleTokenRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request,
     AuthenticationTicket ticket)
     : base(context, options, request, ticket)
 {
     Validate();
 }
Beispiel #11
0
 /// <summary>
 /// Creates a new instance of the <see cref="DeserializeAuthorizationCodeContext"/> class.
 /// </summary>
 public DeserializeAuthorizationCodeContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request,
     string code)
     : base(context, options, request)
 {
     AuthorizationCode = code;
 }
Beispiel #12
0
 /// <summary>
 /// Creates a new instance of the <see cref="DeserializeRefreshTokenContext"/> class.
 /// </summary>
 public DeserializeRefreshTokenContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request,
     string token)
     : base(context, options, request)
 {
     RefreshToken = token;
 }
Beispiel #13
0
 /// <summary>
 /// Initializes base class used for certain event contexts
 /// </summary>
 protected BaseValidatingTicketContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request,
     AuthenticationTicket ticket)
     : base(context, options, request)
 {
     Ticket = ticket;
 }
 /// <summary>
 /// Creates an instance of this context
 /// </summary>
 public HandleAuthorizationRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectMessage request)
     : base(context, options)
 {
     Request = request;
     Validate();
 }
Beispiel #15
0
 /// <summary>
 /// Creates an instance of this context.
 /// </summary>
 public HandleIntrospectionRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request,
     AuthenticationTicket ticket)
     : base(context, options, request)
 {
     Ticket = ticket;
     Validate();
 }
Beispiel #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GrantRefreshTokenContext"/> class
 /// </summary>
 /// <param name="context"></param>
 /// <param name="options"></param>
 /// <param name="request"></param>
 /// <param name="ticket"></param>
 public GrantRefreshTokenContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectMessage request,
     AuthenticationTicket ticket)
     : base(context, options, ticket)
 {
     Request = request;
     Validate();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ValidateUserinfoRequestContext"/> class.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="options"></param>
        /// <param name="request"></param>
        public ValidateUserinfoRequestContext(
            IOwinContext context,
            OpenIdConnectServerOptions options,
            OpenIdConnectMessage request)
            : base(context, options)
        {
            Request = request;

            Validate();
        }
 /// <summary>
 /// Creates an instance of this context
 /// </summary>
 public HandleUserinfoRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectMessage request,
     AuthenticationTicket ticket)
     : base(context, options)
 {
     Request = request;
     Ticket  = ticket;
     Validate();
 }
 /// <summary>
 /// Creates a new instance of the <see cref="ProcessSigninResponseContext"/> class.
 /// </summary>
 public ProcessSigninResponseContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     AuthenticationTicket ticket,
     OpenIdConnectRequest request,
     OpenIdConnectResponse response)
     : base(context, options, request, ticket)
 {
     Validate();
     Response = response;
 }
        /// <summary>
        /// Adds a specs-compliant OpenID Connect server in the OWIN pipeline.
        /// </summary>
        /// <param name="app">The web application builder</param>
        /// <param name="options">Options which control the behavior of the OpenID Connect server.</param>
        /// <returns>The application builder</returns>
        public static IAppBuilder UseOpenIdConnectServer(this IAppBuilder app, OpenIdConnectServerOptions options)
        {
            if (app == null) {
                throw new ArgumentNullException("app");
            }

            if (options == null) {
                throw new ArgumentNullException("options");
            }

            return app.Use(typeof(OpenIdConnectServerMiddleware), app, options);
        }
 /// <summary>
 /// Creates a new instance of the <see cref="ProcessSignoutResponseContext"/> class.
 /// </summary>
 public ProcessSignoutResponseContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     AuthenticationProperties properties,
     OpenIdConnectRequest request,
     OpenIdConnectResponse response)
     : base(context, options, request)
 {
     Validate();
     Properties = properties;
     Response   = response;
 }
Beispiel #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValidateLogoutRequestContext"/> class.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="options"></param>
 /// <param name="request"></param>
 public ValidateLogoutRequestContext(
     IOwinContext context,
     OpenIdConnectServerOptions options,
     OpenIdConnectRequest request)
     : base(context, options, request)
 {
     // Note: if the optional post_logout_redirect_uri parameter
     // is missing, mark the validation context as skipped.
     // See http://openid.net/specs/openid-connect-session-1_0.html#RPLogout
     if (string.IsNullOrEmpty(request.PostLogoutRedirectUri))
     {
         Skip();
     }
 }
        public static string GetIssuer(this IOwinContext context, OpenIdConnectServerOptions options)
        {
            var issuer = options.Issuer;

            if (issuer == null)
            {
                if (!Uri.TryCreate(context.Request.Scheme + "://" + context.Request.Host +
                                   context.Request.PathBase, UriKind.Absolute, out issuer))
                {
                    throw new InvalidOperationException("The issuer address cannot be inferred from the current request");
                }
            }

            return(issuer.AbsoluteUri);
        }