Implicit grant flow

In this section, we will take a look at how to authenticate in our Auth microservice using the implicit flow.

Before we test our flow, let's create a user to enable authentication in the Auth microservice. The following command will create a user in the Auth service:

curl -H "Content-Type: application/json" -X POST -d '{"name":"John Doe","email":"john@doe.com", "password" : "john"}' http://localhost:7777/register

As we can see, the email is john@doe.com and the password is john.

We will use the browser to do this task. Let's go to the following URL:

http://localhost:7777/oauth/authorize?client_id=ecommerce&response_type=token&scope=write&state=8777&redirect_uri=https://httpbin.org/anything

Let's understand the parameters: ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.