Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Use post for /api/v1/users updates #1356

Merged
merged 2 commits into from
Sep 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

/**
Expand Down Expand Up @@ -82,8 +83,11 @@ private void revokeAccessToken(LogoutRequestEvent event) {

private void revokeRefreshToken(LogoutRequestEvent event) {
HttpServletRequest request = event.getRequest();
String refreshToken = refreshTokenCookieResolver.get(request, null).getValue();
revokeToken(refreshToken, TokenTypeHint.REFRESH_TOKEN, request);
Cookie refreshTokenCookie = refreshTokenCookieResolver.get(request, null);
if (refreshTokenCookie != null) {
String refreshToken = refreshTokenCookie.getValue();
revokeToken(refreshToken, TokenTypeHint.REFRESH_TOKEN, request);
}
}

private void revokeToken(String token, TokenTypeHint tokenTypeHint, HttpServletRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,7 @@ public ResourceDataResult filter(final ResourceDataRequest req) {

// if this is an Okta CRUD operation, we must use a PUT and not a POST
HttpMethod method = HttpMethod.POST;
if ((href.matches(".*\\/api\\/v1\\/users\\/\\w*$")
|| href.matches(".*/api/v1/groups/.*"))
if ((href.matches(".*/api/v1/groups/.*"))
&& !create) {
method = HttpMethod.PUT;
}
Expand Down