public Response userInfoIssue(String accessToken, Map<String, Object> claims)
    {
        // Call Authlete's /api/auth/userinfo/issue API.
        UserInfoIssueResponse response = callUserInfoIssue(accessToken, claims);

        // 'action' in the response denotes the next action which
        // this service implementation should take.
        UserInfoIssueResponse.Action action = response.getAction();

        // The content of the response to the client application.
        // The format of the content varies depending on the action.
        String content = response.getResponseContent();

        // Dispatch according to the action.
        switch (action)
        {
            case INTERNAL_SERVER_ERROR:
                // 500 Internal Server Error
                return ResponseUtil.bearerError(Status.INTERNAL_SERVER_ERROR, content);

            case BAD_REQUEST:
                // 400 Bad Request
                return ResponseUtil.bearerError(Status.BAD_REQUEST, content);

            case UNAUTHORIZED:
                // 401 Unauthorized
                return ResponseUtil.bearerError(Status.UNAUTHORIZED, content);

            case FORBIDDEN:
                // 403 Forbidden
                return ResponseUtil.bearerError(Status.FORBIDDEN, content);

            case JSON:
                // 200 OK, application/json;charset=UTF-8
                return ResponseUtil.ok(content);

            case JWT:
                // 200 OK, application/jwt
                return ResponseUtil.ok(content, ResponseUtil.MEDIA_TYPE_JWT);

            default:
                // This never happens.
                throw unknownAction("/api/auth/userinfo/issue", action);
        }
    }
public Response userInfoIssue(String accessToken, Map<String, Object> claims)
    {
        
        UserInfoIssueResponse response = callUserInfoIssue(accessToken, claims);

        
        
        UserInfoIssueResponse.Action action = response.getAction();

        
        
        String content = response.getResponseContent();

        
        switch (action)
        {
            case INTERNAL_SERVER_ERROR:
                
                return ResponseUtil.bearerError(Status.INTERNAL_SERVER_ERROR, content);

            case BAD_REQUEST:
                
                return ResponseUtil.bearerError(Status.BAD_REQUEST, content);

            case UNAUTHORIZED:
                
                return ResponseUtil.bearerError(Status.UNAUTHORIZED, content);

            case FORBIDDEN:
                
                return ResponseUtil.bearerError(Status.FORBIDDEN, content);

            case JSON:
                
                return ResponseUtil.ok(content);

            case JWT:
                
                return ResponseUtil.ok(content, ResponseUtil.MEDIA_TYPE_JWT);

            default:
                
                throw unknownAction("/api/auth/userinfo/issue", action);
        }
    }
public Response userInfoIssue ( String accessToken , Map < String , Object > claims ) { // Call Authlete's /api/auth/userinfo/issue API. UserInfoIssueResponse response = callUserInfoIssue ( accessToken , claims ) ; // 'action' in the response denotes the next action which // this service implementation should take. UserInfoIssueResponse . Action action = response . getAction ( ) ; // The content of the response to the client application. // The format of the content varies depending on the action. String content = response . getResponseContent ( ) ; // Dispatch according to the action. switch ( action ) { case INTERNAL_SERVER_ERROR : // 500 Internal Server Error return ResponseUtil . bearerError ( Status . INTERNAL_SERVER_ERROR , content ) ; case BAD_REQUEST : // 400 Bad Request return ResponseUtil . bearerError ( Status . BAD_REQUEST , content ) ; case UNAUTHORIZED : // 401 Unauthorized return ResponseUtil . bearerError ( Status . UNAUTHORIZED , content ) ; case FORBIDDEN : // 403 Forbidden return ResponseUtil . bearerError ( Status . FORBIDDEN , content ) ; case JSON : // 200 OK, application/json;charset=UTF-8 return ResponseUtil . ok ( content ) ; case JWT : // 200 OK, application/jwt return ResponseUtil . ok ( content , ResponseUtil . MEDIA_TYPE_JWT ) ; default : // This never happens. throw unknownAction ( "/api/auth/userinfo/issue" , action ) ; } }
Issue a JSON or a JWT containing user information.
Issue a JSON or a JWT containing user information .