Join the DZone community and get the full member experience. In general, in basic auth clients call API keeping username:password in the Authorization header for the APIs.

Now for the new clients, you would want to keep the API the same and change the authorization part of the API, maybe the OAuth2 token in the authorization header instead of the basic auth header, something like.

So whenever the spring security chain executed the Springs basic auth filter will be called and internally it calls the dao provider for authentication.

Hope this gives a good idea about the Spring Rest API authentication for Basic Auth and For OAuth2 for that matter any other security protocol as well.

Related Articles