This commit is contained in:
MaxKey
2022-01-18 14:21:49 +08:00
parent d4a8c19c6e
commit ff2cf5b82f
137 changed files with 872 additions and 912 deletions

View File

@@ -71,6 +71,7 @@ public class JwtAdapter extends AbstractAuthorizeAdapter {
.claim("locale", userInfo.getLocale())
.claim(WebConstants.ONLINE_TICKET_NAME, authentication.getOnlineTicket().getTicketId())
.claim("kid", jwtSignerService.getDefaultSignerKeyId())
.claim("institution", userInfo.getInstId())
.build();
_logger.debug("jwt Claims : "+jwtClaims);

View File

@@ -70,6 +70,7 @@ public class JwtDefaultAdapter extends AbstractAuthorizeAdapter {
.claim("locale", userInfo.getLocale())
.claim(WebConstants.ONLINE_TICKET_NAME, authentication.getOnlineTicket().getTicketId())
.claim("kid", jwtSignerService.getDefaultSignerKeyId())
.claim("institution", userInfo.getInstId())
.build();
_logger.debug("jwt Claims : "+jwtClaims);

View File

@@ -73,6 +73,7 @@ public class JwtHS256Adapter extends AbstractAuthorizeAdapter {
.claim("external_id", userInfo.getId())
.claim("locale", userInfo.getLocale())
.claim("kid", "SYMMETRIC-KEY")
.claim("institution", userInfo.getInstId())
.build();
_logger.debug("jwt Claims : "+jwtClaims);

View File

@@ -29,7 +29,7 @@ import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
import org.maxkey.authz.jwt.endpoint.adapter.JwtDefaultAdapter;
import org.maxkey.configuration.ApplicationConfig;
import org.maxkey.constants.Boolean;
import org.maxkey.constants.ConstsBoolean;
import org.maxkey.entity.apps.Apps;
import org.maxkey.entity.apps.AppsJwtDetails;
import org.maxkey.persistence.service.AppsJwtDetailsService;
@@ -82,7 +82,7 @@ public class JwtAuthorizeEndpoint extends AuthorizeBaseEndpoint{
jwtDetails.setIsAdapter(application.getIsAdapter());
AbstractAuthorizeAdapter adapter;
if(Boolean.isTrue(jwtDetails.getIsAdapter())){
if(ConstsBoolean.isTrue(jwtDetails.getIsAdapter())){
adapter =(AbstractAuthorizeAdapter)Instance.newInstance(jwtDetails.getAdapter());
}else{
adapter =(AbstractAuthorizeAdapter)jwtDefaultAdapter;