-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1851 add oura ring api key #1461
base: main
Are you sure you want to change the base?
Conversation
private TokenIntrospectionResponse getTokenIntrospectResponse(HttpServletRequest httpRequest) { | ||
AuthorizationRequest request = new AuthorizationRequest(); | ||
AuthorizationResponse response = authzClient.authorization(httpRequest.getHeader("Authorization").replace("Bearer ", "")).authorize(request); | ||
|
||
} else if (request.getRequestURI().contains("getPhoneIds")) { | ||
validateInputGetPhoneIds(requestParams); | ||
JSONArray phoneIds = kgQueryClient.getPhoneIds(requestParams.getString("userId")); | ||
JSONObject result = new JSONObject(); | ||
result.put("PhoneIds", phoneIds); | ||
result.put("Comment", "Phone ids are retrieved."); | ||
return result; | ||
TokenIntrospectionResponse tokenIntrospectionResponse = authzClient.protection().introspectRequestingPartyToken(response.getToken()); | ||
return tokenIntrospectionResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the purpose of this method? I think the /userinfo endpoint already validates the token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is to check whether the token has the permission to perform the operations (eg. registerPhone
, getPhoneIds
, registerOuraRing
), although we now allow all users to perform these three operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, just wondering if there is a way to only contact KeyCloak once instead of twice
add oura ring api key to twa account mapping