Search in sources :

Example 1 with AuthenticationRequestParametersHandler

use of io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestParametersHandler in project gravitee-access-management by gravitee-io.

the class CIBAProvider method initRouter.

private void initRouter() {
    final Router cibaRouter = Router.router(vertx);
    final String certificateHeader = environment.getProperty(ConstantKeys.HTTP_SSL_CERTIFICATE_HEADER);
    final Handler<RoutingContext> clientAuthHandler = ClientAuthHandler.create(clientSyncService, clientAssertionService, jwkService, domain, certificateHeader);
    cibaRouter.route(HttpMethod.OPTIONS, AUTHENTICATION_ENDPOINT).handler(corsHandler);
    cibaRouter.route(HttpMethod.POST, AUTHENTICATION_ENDPOINT).handler(corsHandler).handler(clientAuthHandler).handler(new AuthorizationRequestParseProviderConfigurationHandler(this.openIDDiscoveryService)).handler(new AuthenticationRequestParseRequestObjectHandler(this.requestObjectService, this.domain)).handler(new AuthenticationRequestParametersHandler(domain, jwsService, jwkService, userService)).handler(new AuthenticationRequestAcknowledgeHandler(authService, domain, jwtService));
    // To process the callback content we perform authentication of the caller that must be registered as AM client.
    // If a plugin need a non authenticate webhook, we should create another endpoint without clientAuthHandler.
    cibaRouter.route(HttpMethod.OPTIONS, AUTHENTICATION_CALLBACK_ENDPOINT).handler(corsHandler);
    cibaRouter.route(HttpMethod.POST, AUTHENTICATION_CALLBACK_ENDPOINT).handler(corsHandler).handler(clientAuthHandler).handler(new AuthenticationRequestCallbackHandler(authService));
    errorHandler(cibaRouter);
    router.mountSubRouter(path(), cibaRouter);
}
Also used : AuthenticationRequestParametersHandler(io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestParametersHandler) RoutingContext(io.vertx.reactivex.ext.web.RoutingContext) AuthenticationRequestAcknowledgeHandler(io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestAcknowledgeHandler) Router(io.vertx.reactivex.ext.web.Router) AuthenticationRequestCallbackHandler(io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestCallbackHandler) AuthenticationRequestParseRequestObjectHandler(io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestParseRequestObjectHandler) AuthorizationRequestParseProviderConfigurationHandler(io.gravitee.am.gateway.handler.oauth2.resources.handler.authorization.AuthorizationRequestParseProviderConfigurationHandler)

Aggregations

AuthenticationRequestAcknowledgeHandler (io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestAcknowledgeHandler)1 AuthenticationRequestCallbackHandler (io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestCallbackHandler)1 AuthenticationRequestParametersHandler (io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestParametersHandler)1 AuthenticationRequestParseRequestObjectHandler (io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestParseRequestObjectHandler)1 AuthorizationRequestParseProviderConfigurationHandler (io.gravitee.am.gateway.handler.oauth2.resources.handler.authorization.AuthorizationRequestParseProviderConfigurationHandler)1 Router (io.vertx.reactivex.ext.web.Router)1 RoutingContext (io.vertx.reactivex.ext.web.RoutingContext)1