Search in sources :

Example 1 with RestletRealmRouter

use of org.forgerock.openam.rest.service.RestletRealmRouter in project OpenAM by OpenRock.

the class OAuth2RouterProvider method get.

@Override
public Router get() {
    final Router router = new RestletRealmRouter(realmValidator, coreWrapper);
    // Standard OAuth2 endpoints
    router.attach("/authorize", auditWithOAuthFilter(new AuthorizeEndpointFilter(wrap(AuthorizeResource.class), jacksonRepresentationFactory)));
    router.attach("/access_token", auditWithOAuthFilter(new TokenEndpointFilter(new AccessTokenFlowFinder(), jacksonRepresentationFactory), formAuditor(RESPONSE_TYPE, GRANT_TYPE, CLIENT_ID, USERNAME, SCOPE, REDIRECT_URI), jacksonAuditor(SCOPE, TOKEN_TYPE)));
    router.attach("/tokeninfo", auditWithOAuthFilter(wrap(ValidationServerResource.class), noBodyAuditor(), jacksonAuditor(SCOPE, TOKEN_TYPE)));
    // OAuth 2.0 Token Introspection Endpoint
    router.attach("/introspect", auditWithOAuthFilter(wrap(TokenIntrospectionResource.class), formAuditor(TOKEN_TYPE_HINT), jsonAuditor(SCOPE, TOKEN_TYPE, CLIENT_ID, USERNAME, ACTIVE)));
    // OpenID Connect endpoints
    router.attach("/connect/register", auditWithOAuthFilter(wrap(ConnectClientRegistration.class), jsonAuditor(CLIENT_NAME.getType(), APPLICATION_TYPE.getType(), REDIRECT_URIS.getType()), jacksonAuditor(CLIENT_ID, CLIENT_NAME.getType(), APPLICATION_TYPE.getType(), REDIRECT_URIS.getType())));
    router.attach("/userinfo", auditWithOAuthFilter(wrap(UserInfo.class)));
    router.attach("/connect/endSession", auditWithOAuthFilter(wrap(EndSession.class)));
    router.attach("/connect/jwk_uri", auditWithOAuthFilter(wrap(OpenIDConnectJWKEndpoint.class)));
    // Resource Set Registration
    Restlet resourceSetRegistrationEndpoint = auditWithOAuthFilter(getRestlet(OAuth2Constants.Custom.RSR_ENDPOINT), jsonAuditor(NAME, SCOPES), jacksonAuditor("_id"));
    router.attach("/resource_set/{rsid}", resourceSetRegistrationEndpoint);
    router.attach("/resource_set", resourceSetRegistrationEndpoint);
    router.attach("/resource_set/", resourceSetRegistrationEndpoint);
    // OpenID Connect Discovery
    router.attach("/.well-known/openid-configuration", auditWithOAuthFilter(wrap(OpenIDConnectConfiguration.class)));
    // OAuth 2 Device Flow
    router.attach("/device/user", auditWithOAuthFilter(wrap(DeviceCodeVerificationResource.class)));
    router.attach("/device/code", auditWithOAuthFilter(wrap(DeviceCodeResource.class), formAuditor(RESPONSE_TYPE, GRANT_TYPE, CLIENT_ID, SCOPE), noBodyAuditor()));
    return router;
}
Also used : RestletRealmRouter(org.forgerock.openam.rest.service.RestletRealmRouter) Restlet(org.restlet.Restlet) AuthorizeResource(org.forgerock.oauth2.restlet.AuthorizeResource) AuthorizeEndpointFilter(org.forgerock.oauth2.restlet.AuthorizeEndpointFilter) RestletRealmRouter(org.forgerock.openam.rest.service.RestletRealmRouter) Router(org.restlet.routing.Router) TokenEndpointFilter(org.forgerock.oauth2.restlet.TokenEndpointFilter) AccessTokenFlowFinder(org.forgerock.oauth2.restlet.AccessTokenFlowFinder)

Example 2 with RestletRealmRouter

use of org.forgerock.openam.rest.service.RestletRealmRouter in project OpenAM by OpenRock.

the class XacmlRouterProvider method get.

@Override
public Router get() {
    RestletRealmRouter router = new RestletRealmRouter(realmValidator, coreWrapper);
    ResourceApiVersionRestlet policiesVersionRouter = new ResourceApiVersionRestlet(versionBehaviourManager);
    policiesVersionRouter.attach(version(1), wrap(XacmlService.class));
    router.attach("/policies", policiesVersionRouter);
    invalidRealmNames.add("policies");
    return router;
}
Also used : XacmlService(org.forgerock.openam.xacml.v3.rest.XacmlService) RestletRealmRouter(org.forgerock.openam.rest.service.RestletRealmRouter) ResourceApiVersionRestlet(org.forgerock.openam.rest.service.ResourceApiVersionRestlet)

Example 3 with RestletRealmRouter

use of org.forgerock.openam.rest.service.RestletRealmRouter in project OpenAM by OpenRock.

the class WebFinger method createInboundRoot.

/**
     * Creates the endpoint handler registrations for the OpenId Connect web finger endpoints.
     *
     * @return {@inheritDoc}
     */
@Override
public Restlet createInboundRoot() {
    final Router root = new RestletRealmRouter(realmValidator, coreWrapper);
    /**
         * For now we only use webfinger for OpenID Connect. Once the standard is finalized
         * or we decide to use it for other tasks we dont need a full blown handler
         */
    root.attach("/webfinger", auditWithOAuthFilter(new GuicedRestlet(getContext(), OpenIDConnectDiscovery.class)));
    return root;
}
Also used : RestletRealmRouter(org.forgerock.openam.rest.service.RestletRealmRouter) GuicedRestlet(org.forgerock.oauth2.restlet.GuicedRestlet) RestletRealmRouter(org.forgerock.openam.rest.service.RestletRealmRouter) Router(org.restlet.routing.Router)

Example 4 with RestletRealmRouter

use of org.forgerock.openam.rest.service.RestletRealmRouter in project OpenAM by OpenRock.

the class UmaRouterProvider method get.

@Override
public Router get() {
    Router router = new RestletRealmRouter(realmValidator, coreWrapper);
    router.attach("/permission_request", auditWithUmaFilter(getRestlet(PERMISSION_REQUEST_ENDPOINT), jsonAuditor(RESOURCE_SET_ID, SCOPES), noBodyAuditor()));
    router.attach("/authz_request", auditWithUmaFilter(getRestlet(AUTHORIZATION_REQUEST_ENDPOINT), noBodyAuditor(), noBodyAuditor()));
    // Well-Known Discovery
    router.attach("/.well-known/uma-configuration", auditWithUmaFilter(wrap(UmaWellKnownConfigurationEndpoint.class), noBodyAuditor(), noBodyAuditor()));
    return router;
}
Also used : RestletRealmRouter(org.forgerock.openam.rest.service.RestletRealmRouter) RestletRealmRouter(org.forgerock.openam.rest.service.RestletRealmRouter) Router(org.restlet.routing.Router)

Aggregations

RestletRealmRouter (org.forgerock.openam.rest.service.RestletRealmRouter)4 Router (org.restlet.routing.Router)3 AccessTokenFlowFinder (org.forgerock.oauth2.restlet.AccessTokenFlowFinder)1 AuthorizeEndpointFilter (org.forgerock.oauth2.restlet.AuthorizeEndpointFilter)1 AuthorizeResource (org.forgerock.oauth2.restlet.AuthorizeResource)1 GuicedRestlet (org.forgerock.oauth2.restlet.GuicedRestlet)1 TokenEndpointFilter (org.forgerock.oauth2.restlet.TokenEndpointFilter)1 ResourceApiVersionRestlet (org.forgerock.openam.rest.service.ResourceApiVersionRestlet)1 XacmlService (org.forgerock.openam.xacml.v3.rest.XacmlService)1 Restlet (org.restlet.Restlet)1