|
1 | 1 | /* |
2 | | - * Copyright (C) 2022 Authlete, Inc. |
| 2 | + * Copyright (C) 2022-2023 Authlete, Inc. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
21 | 21 | import javax.ws.rs.Path; |
22 | 22 | import javax.ws.rs.core.Response; |
23 | 23 | import com.authlete.common.api.AuthleteApiFactory; |
| 24 | +import com.authlete.common.dto.FederationConfigurationRequest; |
| 25 | +import com.authlete.common.types.EntityType; |
24 | 26 | import com.authlete.jaxrs.BaseFederationConfigurationEndpoint; |
25 | 27 |
|
26 | 28 |
|
|
29 | 31 | * |
30 | 32 | * <p> |
31 | 33 | * An OpenID Provider that supports <a href= |
32 | | - * "https://openid.net/specs/openid-connect-federation-1_0.html">OpenID Connect |
| 34 | + * "https://openid.net/specs/openid-federation-1_0.html">OpenID |
33 | 35 | * Federation 1.0</a> must provide an endpoint that returns its <b>entity |
34 | 36 | * configuration</b> in the JWT format. The URI of the endpoint is defined |
35 | 37 | * as follows: |
|
45 | 47 | * <p> |
46 | 48 | * <b>Entity ID</b> is a URL that identifies an OpenID Provider (and other |
47 | 49 | * entities including Relying Parties, Trust Anchors and Intermediate |
48 | | - * Authorities) in the context of OpenID Connect Federation 1.0. |
| 50 | + * Authorities) in the context of OpenID Federation 1.0. |
49 | 51 | * </p> |
50 | 52 | * |
51 | 53 | * <p> |
52 | | - * Note that OpenID Connect Federation 1.0 is supported since Authlete 2.3. |
| 54 | + * Note that OpenID Federation 1.0 is supported since Authlete 2.3. |
53 | 55 | * </p> |
54 | 56 | * |
55 | | - * @see <a href="https://openid.net/specs/openid-connect-federation-1_0.html" |
56 | | - * >OpenID Connect Federation 1.0</a> |
| 57 | + * @see <a href="https://openid.net/specs/openid-federation-1_0.html" |
| 58 | + * >OpenID Federation 1.0</a> |
57 | 59 | */ |
58 | 60 | @Path("/.well-known/openid-federation") |
59 | 61 | public class FederationConfigurationEndpoint extends BaseFederationConfigurationEndpoint |
60 | 62 | { |
| 63 | + /** |
| 64 | + * The request to Authlete's /federation/configuration API. |
| 65 | + */ |
| 66 | + private static final FederationConfigurationRequest REQUEST = |
| 67 | + new FederationConfigurationRequest() |
| 68 | + .setEntityTypes(new EntityType[] { |
| 69 | + EntityType.OPENID_PROVIDER, |
| 70 | + EntityType.OPENID_CREDENTIAL_ISSUER |
| 71 | + }); |
| 72 | + |
| 73 | + |
61 | 74 | /** |
62 | 75 | * Entity configuration endpoint. |
63 | 76 | */ |
64 | 77 | @GET |
65 | 78 | public Response get() |
66 | 79 | { |
67 | 80 | // Handle the request to the endpoint. |
68 | | - return handle(AuthleteApiFactory.getDefaultApi()); |
| 81 | + return handle(AuthleteApiFactory.getDefaultApi(), REQUEST); |
69 | 82 | } |
70 | 83 | } |
0 commit comments