Skip to content

Commit 7994405

Browse files
Merge pull request #84 from authlete/challenge-endpoint
feat: OAuth 2.0 Attestation-Based Client Authentication / Challenge Endpoint
2 parents e04088b + fd5731c commit 7994405

3 files changed

Lines changed: 76 additions & 2 deletions

File tree

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414

15-
<authlete.java.common.version>4.35</authlete.java.common.version>
16-
<authlete.java.jaxrs.version>2.90</authlete.java.jaxrs.version>
15+
<authlete.java.common.version>4.39</authlete.java.common.version>
16+
<authlete.java.jaxrs.version>2.93</authlete.java.jaxrs.version>
1717
<authlete.cbor.version>1.21</authlete.cbor.version>
1818
<javax.servlet-api.version>3.0.1</javax.servlet-api.version>
1919
<jersey.version>2.34</jersey.version>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright (C) 2026 Authlete, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing,
11+
* software distributed under the License is distributed on an
12+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13+
* either express or implied. See the License for the specific
14+
* language governing permissions and limitations under the
15+
* License.
16+
*/
17+
package com.authlete.jaxrs.server.api.attestation;
18+
19+
20+
import javax.ws.rs.POST;
21+
import javax.ws.rs.Path;
22+
import javax.ws.rs.core.Response;
23+
import com.authlete.common.api.AuthleteApi;
24+
import com.authlete.common.api.AuthleteApiFactory;
25+
import com.authlete.common.dto.AttestationChallengeRequest;
26+
import com.authlete.jaxrs.BaseAttestationChallengeEndpoint;
27+
28+
29+
/**
30+
* An implementation of the challenge endpoint defined in the <a href=
31+
* "https://datatracker.ietf.org/doc/draft-ietf-oauth-attestation-based-client-auth/"
32+
* >OAuth 2&#x2E;0 Attestation-Based Client Authentication</a>.
33+
*
34+
* @see <a href="https://datatracker.ietf.org/doc/draft-ietf-oauth-attestation-based-client-auth/">
35+
* OAuth 2.0 Attestation-Based Client Authentication</a>
36+
*/
37+
@Path("/api/challenge")
38+
public class AttestationChallengeEndpoint extends BaseAttestationChallengeEndpoint
39+
{
40+
/**
41+
* The challenge endpoint.
42+
*
43+
* <p>
44+
* From <a href=
45+
* "https://datatracker.ietf.org/doc/draft-ietf-oauth-attestation-based-client-auth/"
46+
* >OAuth 2.0 Attestation-Based Client Authentication</a>:
47+
* </p>
48+
*
49+
* <blockquote>
50+
* <p>
51+
* A request for a Challenge is made by sending an HTTP POST request to the URL
52+
* provided in the {@code challenge_endpoint} of the Authorization Serve metadata.
53+
* </p>
54+
* </blockquote>
55+
*
56+
* @return
57+
* A response from the challenge endpoint.
58+
*/
59+
@POST
60+
public Response post()
61+
{
62+
// Authlete API interface
63+
AuthleteApi api = AuthleteApiFactory.getDefaultApi();
64+
65+
// Request to the Authlete's /api/{service-id}/attestation/challenge API
66+
AttestationChallengeRequest request =
67+
new AttestationChallengeRequest()
68+
.setPretty(true);
69+
70+
// Process the request.
71+
return handle(api, request);
72+
}
73+
}

src/main/webapp/WEB-INF/web.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
org.glassfish.jersey.moxy.json.MoxyJsonFeature,
7272
org.glassfish.jersey.server.mvc.jsp.JspMvcFeature,
7373
com.authlete.jaxrs.server.decorator.FapiInteractionIdResponseFilter,
74+
com.authlete.jaxrs.server.api.attestation.AttestationChallengeEndpoint,
7475
</param-value>
7576
</init-param>
7677

0 commit comments

Comments
 (0)