I am looking for a way of obtaining the OAuth2 token from an app engine java endpoint.
I am aware of doing this, for example:
@ApiMethod(name = "getMyResponse", path = "getMyResponse", httpMethod = ApiMethod.HttpMethod.GET)
public MyResponse getMyResponse(final User user, HttpServletRequest request)
throws UserUnauthorizedException {
String authorizationHeader = request.getHeader("Authorization");
String token = authorizationHeader.substring(7);
//do something with the token here
}
However, i am looking for something a bit more "civilized", than parsing strings from the HTTP header (like using some API, for example). Any ideas?