Package de.trustable.ca3s.core.web.rest
Class OIDCAuthenticationResource
- java.lang.Object
-
- de.trustable.ca3s.core.web.rest.OIDCAuthenticationResource
-
@RestController @RequestMapping("/oidc") public class OIDCAuthenticationResource extends ObjectREST controller for managing the current user login using KeyCloak.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCERTIFICATE_IDstatic StringCSR_IDstatic StringINITIAL_URI_PARAM_NAMEstatic StringPIPELINE_IDstatic StringREDIRECT_URI_PARAM_PATHstatic StringSHOW_NAV_BAR
-
Constructor Summary
Constructors Constructor Description OIDCAuthenticationResource(TokenProvider tokenProvider, String keycloakAuthorizationUri, String realm, String clientId, String flowType, OIDCRestService OIDCRestService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<String>getAuthenticatedUser(javax.servlet.http.HttpServletRequest request, Map<String,String> allParams)GET /authenticate: check if the user is authenticated, and return its login.org.springframework.http.ResponseEntity<String>getCode(javax.servlet.http.HttpServletRequest request, Map<String,String> allParams)org.springframework.http.ResponseEntity<String>getToken(javax.servlet.http.HttpServletRequest request, String access_token, Map<String,String> allParams)org.springframework.http.ResponseEntitylogout(javax.servlet.http.HttpServletRequest request)
-
-
-
Field Detail
-
INITIAL_URI_PARAM_NAME
public static final String INITIAL_URI_PARAM_NAME
- See Also:
- Constant Field Values
-
REDIRECT_URI_PARAM_PATH
public static final String REDIRECT_URI_PARAM_PATH
- See Also:
- Constant Field Values
-
PIPELINE_ID
public static final String PIPELINE_ID
- See Also:
- Constant Field Values
-
CERTIFICATE_ID
public static final String CERTIFICATE_ID
- See Also:
- Constant Field Values
-
CSR_ID
public static final String CSR_ID
- See Also:
- Constant Field Values
-
SHOW_NAV_BAR
public static final String SHOW_NAV_BAR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OIDCAuthenticationResource
public OIDCAuthenticationResource(TokenProvider tokenProvider, @Value("${ca3s.oidc.auth-server-url:}") String keycloakAuthorizationUri, @Value("${ca3s.oidc.realm:@null}") String realm, @Value("${ca3s.oidc.client-id:#{null}}") String clientId, @Value("${ca3s.oidc.flow-type:code}") String flowType, OIDCRestService OIDCRestService)
-
-
Method Detail
-
getAuthenticatedUser
@CrossOrigin @GetMapping("/authenticate") public org.springframework.http.ResponseEntity<String> getAuthenticatedUser(javax.servlet.http.HttpServletRequest request, @RequestParam Map<String,String> allParams)GET /authenticate: check if the user is authenticated, and return its login.- Parameters:
request- the HTTP request.- Returns:
- the login if the user is authenticated.
-
getCode
@GetMapping({"/code","/code/"}) public org.springframework.http.ResponseEntity<String> getCode(javax.servlet.http.HttpServletRequest request, @RequestParam Map<String,String> allParams)
-
getToken
@GetMapping("/tokenImplicit") public org.springframework.http.ResponseEntity<String> getToken(javax.servlet.http.HttpServletRequest request, @RequestParam(required=false,name="access_token") String access_token, @RequestParam Map<String,String> allParams)
-
logout
@CrossOrigin @PostMapping("/logout") public org.springframework.http.ResponseEntity logout(javax.servlet.http.HttpServletRequest request)
-
-