diff --git a/Model/src/main/java/org/gusdb/wdk/session/WdkOAuthClientWrapper.java b/Model/src/main/java/org/gusdb/wdk/session/WdkOAuthClientWrapper.java index 6c42fa052..fd5a27734 100644 --- a/Model/src/main/java/org/gusdb/wdk/session/WdkOAuthClientWrapper.java +++ b/Model/src/main/java/org/gusdb/wdk/session/WdkOAuthClientWrapper.java @@ -33,20 +33,20 @@ public WdkOAuthClientWrapper(WdkModel wdkModel) throws WdkModelException { } } - public ValidatedToken getValidatedIdTokenFromAuth(String authCode, String redirectUri) { - return _client.getValidatedAuthToken(_config, authCode, redirectUri); + public ValidatedToken getAuthTokenFromAuthCode(String authCode, String redirectUri) { + return _client.getAuthTokenFromAuthCode(_config, authCode, redirectUri); } - public ValidatedToken getValidatedIdTokenFromCredentials(String email, String password, String redirectUrl) { - return _client.getValidatedAuthToken(_config, email, password, redirectUrl); + public ValidatedToken getAuthTokenFromCredentials(String email, String password, String redirectUrl) { + return _client.getAuthTokenFromUsernamePassword(_config, email, password, redirectUrl); } - public ValidatedToken getValidatedBearerTokenFromAuth(String authCode, String redirectUri) { - return _client.getValidatedBearerToken(_config, authCode, redirectUri); + public ValidatedToken getBearerTokenFromAuth(String authCode, String redirectUri) { + return _client.getBearerTokenFromAuthCode(_config, authCode, redirectUri); } - public ValidatedToken getValidatedBearerTokenFromCredentials(String email, String password, String redirectUrl) { - return _client.getValidatedBearerToken(_config, email, password, redirectUrl); + public ValidatedToken getBearerTokenFromCredentials(String email, String password, String redirectUrl) { + return _client.getBearerTokenFromUsernamePassword(_config, email, password, redirectUrl); } public User getUserFromValidatedToken(ValidatedToken token, UserFactory userFactory) { @@ -54,8 +54,8 @@ public User getUserFromValidatedToken(ValidatedToken token, UserFactory userFact User user = new RegisteredUser(_wdkModel, Long.parseLong(claims.getSubject()), - claims.get("email", String.class), - "deprecated", // user signature + claims.get(IdTokenFields.email.name(), String.class), + claims.get(IdTokenFields.signature.name(), String.class), claims.get(IdTokenFields.preferred_username.name(), String.class)); // have to hit the user data endpoint for this for user details; bearer token does not include all fields diff --git a/Service/src/main/java/org/gusdb/wdk/service/service/SessionService.java b/Service/src/main/java/org/gusdb/wdk/service/service/SessionService.java index 949251ab5..1172ac214 100644 --- a/Service/src/main/java/org/gusdb/wdk/service/service/SessionService.java +++ b/Service/src/main/java/org/gusdb/wdk/service/service/SessionService.java @@ -164,7 +164,7 @@ public Response processOauthLogin( WdkOAuthClientWrapper client = new WdkOAuthClientWrapper(wdkModel); // Use auth code to get the bearer token, then convert to User - ValidatedToken bearerToken = client.getValidatedBearerTokenFromAuth(authCode, appUrl); + ValidatedToken bearerToken = client.getBearerTokenFromAuth(authCode, appUrl); User newUser = client.getUserFromValidatedToken(bearerToken, wdkModel.getUserFactory()); // transfer ownership from guest to logged-in user @@ -209,7 +209,7 @@ public Response processDbLogin(@HeaderParam(REFERRER_HEADER_KEY) String referrer WdkOAuthClientWrapper client = new WdkOAuthClientWrapper(wdkModel); // Use passed credentials to get the bearer token, then convert to User - ValidatedToken bearerToken = client.getValidatedBearerTokenFromCredentials(request.getEmail(), request.getPassword(), appUrl); + ValidatedToken bearerToken = client.getBearerTokenFromCredentials(request.getEmail(), request.getPassword(), appUrl); User newUser = client.getUserFromValidatedToken(bearerToken, wdkModel.getUserFactory());