完成 oauth2 implicit 简化模式的实现

This commit is contained in:
YunaiV
2022-05-14 23:47:34 +08:00
parent 7d1deab48b
commit 6ca88277d8
17 changed files with 208 additions and 35 deletions

View File

@ -20,6 +20,8 @@ import java.util.Collections;
*/
public class SecurityFrameworkUtils {
public static final String TOKEN_TYPE = "Bearer";
private SecurityFrameworkUtils() {}
/**
@ -34,7 +36,7 @@ public class SecurityFrameworkUtils {
if (!StringUtils.hasText(authorization)) {
return null;
}
int index = authorization.indexOf("Bearer ");
int index = authorization.indexOf(TOKEN_TYPE + " ");
if (index == -1) { // 未找到
return null;
}