Java Code Examples for org.keycloak.KeycloakSecurityContext#getIdToken()
The following examples show how to use
org.keycloak.KeycloakSecurityContext#getIdToken() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LDAPPictureServlet.java From keycloak with Apache License 2.0 | 6 votes |
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.setContentType("image/jpeg"); ServletOutputStream outputStream = resp.getOutputStream(); KeycloakSecurityContext securityContext = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); IDToken idToken = securityContext.getIdToken(); String profilePicture = idToken.getPicture(); if (profilePicture != null) { byte[] decodedPicture = Base64.decode(profilePicture); outputStream.write(decodedPicture); } outputStream.flush(); }
Example 2
Source File: CustomerDatabaseClient.java From keycloak with Apache License 2.0 | 4 votes |
public static IDToken getIDToken(HttpServletRequest req) { KeycloakSecurityContext session = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); return session.getIdToken(); }
Example 3
Source File: CustomerDatabaseClient.java From keycloak with Apache License 2.0 | 4 votes |
public static IDToken getIDToken(HttpServletRequest req) { KeycloakSecurityContext session = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); return session.getIdToken(); }
Example 4
Source File: CxfRsClient.java From keycloak with Apache License 2.0 | 4 votes |
public static IDToken getIDToken(HttpServletRequest req) { KeycloakSecurityContext session = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); return session.getIdToken(); }