use of io.gravitee.am.gateway.handler.ciba.resources.handler.AuthenticationRequestParseRequestObjectHandler 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);
}
Aggregations