OAuth2RouterProvider.java revision 428d85cb974cd1b98284f023a69bc6af5fb94723
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
*/
/**
* Guice Provider from getting the OAuth2 HTTP router.
*
* @since 13.0.0
*/
private final RestRealmValidator realmValidator;
private final CoreWrapper coreWrapper;
private final RestletAccessAuditFilterFactory restletAuditFactory;
/**
* Constructs a new RestEndpoints instance.
*
* @param realmValidator An instance of the RestRealmValidator.
* @param coreWrapper An instance of the CoreWrapper.
* @param restletAuditFactory An instance of the RestletAccessAuditFilterFactory.
*/
this.realmValidator = realmValidator;
this.coreWrapper = coreWrapper;
}
// Standard OAuth2 endpoints
new TokenEndpointFilter(new AccessTokenFlowFinder())));
router.attach("/tokeninfo", restletAuditFactory.createFilter(OAUTH2, wrap(ValidationServerResource.class)));
// OAuth 2.0 Token Introspection Endpoint
router.attach("/introspect", restletAuditFactory.createFilter(OAUTH2, wrap(TokenIntrospectionResource.class)));
// OpenID Connect endpoints
// Resource Set Registration
router.attach("/resource_set/{rsid}", restletAuditFactory.createFilter(OAUTH2, resourceSetRegistrationEndpoint));
router.attach("/resource_set", restletAuditFactory.createFilter(OAUTH2, resourceSetRegistrationEndpoint));
router.attach("/resource_set/", restletAuditFactory.createFilter(OAUTH2,resourceSetRegistrationEndpoint));
// OpenID Connect Discovery
// Device Code
return router;
}
}
}