java.lang.Object
io.getlime.security.powerauth.rest.api.spring.controller.v2.TokenController

@RestController("tokenControllerV2")
@RequestMapping("/pa/token")
public class TokenController
extends Object
Controller responsible for publishing services related to simple token-based authentication.

PowerAuth protocol versions:

  • 2.0
  • 2.1
Author:
Petr Dvorak, petr@wultra.com
  • Constructor Summary

    Constructors
    Constructor Description
    TokenController()  
  • Method Summary

    Modifier and Type Method Description
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.rest.api.model.response.v2.TokenCreateResponse> createToken​(io.getlime.core.rest.model.base.request.ObjectRequest<io.getlime.security.powerauth.rest.api.model.request.v2.TokenCreateRequest> request, PowerAuthApiAuthentication authentication)
    Create token.
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.rest.api.model.response.v3.TokenRemoveResponse> removeToken​(io.getlime.core.rest.model.base.request.ObjectRequest<io.getlime.security.powerauth.rest.api.model.request.v3.TokenRemoveRequest> request, PowerAuthApiAuthentication authentication)
    Remove token.
    void setTokenServiceV2​(TokenService tokenServiceV2)
    Set the token verification service via setter injection.
    void setTokenServiceV3​(TokenService tokenServiceV3)
    Set the token verification service via setter injection.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TokenController

      public TokenController()
  • Method Details

    • setTokenServiceV2

      @Autowired public void setTokenServiceV2​(TokenService tokenServiceV2)
      Set the token verification service via setter injection.
      Parameters:
      tokenServiceV2 - Token verification service (v2).
    • setTokenServiceV3

      @Autowired public void setTokenServiceV3​(TokenService tokenServiceV3)
      Set the token verification service via setter injection.
      Parameters:
      tokenServiceV3 - Token verification service (v3).
    • createToken

      @RequestMapping(value="create", method=POST) public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.rest.api.model.response.v2.TokenCreateResponse> createToken​(@RequestBody io.getlime.core.rest.model.base.request.ObjectRequest<io.getlime.security.powerauth.rest.api.model.request.v2.TokenCreateRequest> request, PowerAuthApiAuthentication authentication) throws PowerAuthAuthenticationException
      Create token.
      Parameters:
      request - Create token request.
      authentication - PowerAuth API authentication object.
      Returns:
      Create token response.
      Throws:
      PowerAuthAuthenticationException - In case authentication fails or request is invalid.
    • removeToken

      @RequestMapping(value="remove", method=POST) public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.rest.api.model.response.v3.TokenRemoveResponse> removeToken​(@RequestBody io.getlime.core.rest.model.base.request.ObjectRequest<io.getlime.security.powerauth.rest.api.model.request.v3.TokenRemoveRequest> request, PowerAuthApiAuthentication authentication) throws PowerAuthAuthenticationException
      Remove token.
      Parameters:
      request - Remove token request.
      authentication - PowerAuth API authentication object.
      Returns:
      Remove token response.
      Throws:
      PowerAuthAuthenticationException - In case authentication fails or request is invalid.