BearerToken.parse(String) in authlete-java-common covers the three ways to extract an access token described in RFC 6750 (Bearer Token Usage).
// Case 1:
// Extract an access token from 'Authorization' HTTP header.
// The value of 'Authorization' HTTP header.
String authorization = ...;
// Extract an access token from 'Authorization' HTTP header.
String accessToken = BearerToken.parse(authorization);
// Case 2:
// Extract an access token from the entity body of a POST request.
// Entity body formatted in 'application/x-www-url-encoded'.
String body = ...;
// Extract an access token.
String accessToken = BearerToken.parse(body);
// Case 3:
// Extract an access token from the query string of a GET request.
// Query string.
String query = ...;
// Extract an access token.
String accessToken = BearerToken.parse(query);
Maven:
<dependency>
<groupId>com.authlete</groupId>
<artifactId>authlete-java-common</artifactId>
<version>1.3</version>
</dependency>
It wouldn't take much time even if you implemented the same thing from scratch, though.
Source code -> BearerToken.java