Announcement Announcement Module
Collapse
No announcement yet.
Implementing token based auth for RESTful service API Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Implementing token based auth for RESTful service API

    Hello

    I would like to create the following API:
    /api-login - logins user and returns token
    /api/{token}/add - add user's item

    Am I able to define 2 different Spring Security configurations - main security config and API security config? The problem is that after login Spring Security gets login information from session. This is correct for main security area but not for API

  • #2
    you could implement a spring security filter at position "PRE_AUTH_FILTER" that checks if the token is present in a http-header. (eg. in J_SESSIONID). this way the browsers understands it too.

    Comment

    Working...
    X