> For the complete documentation index, see [llms.txt](https://docs.scaffold.ly/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scaffold.ly/how-tos/microservices/user-authentication.md).

# User Authentication

If you enabled the Authentication microservice, additional services are pre-wired to use it for pass-through authentication.

Within other microservices, use the `@Securty('jwt')` annotation in the Controller on methods to enforce that an `Authorization` header is required with the request.

![](/files/tv9XAdyIzeMF5t8hgwqC)

### Testing Authentication Locally

Microservices running **Locally** are configured to allow authentication tokens from the **Nonlive** environment.

Go to the [Scaffoldly Dashboard](https://start.scaffold.ly/dashboard) and find the JWT Token Generator

![](/files/BbrtbgFj4rjgJU2vPBO0)

By default, emails can only be sent to your Scaffoldly email account, also shown on the Dashboard

![](/files/3FOzydegPym11dEm5TdU)

![](/files/YghIRe3fSdLE3BrAB1tT) ![](/files/bQEadhvJ8zPtwUzI6W0v) ![](/files/fGGUETYyPIAhEWUAy6I2) ![](/files/Rg0ywOksu3MTNygEiULq)

Run your [Microservice locally](/how-tos/microservices/running-locally.md) (optionally in [Debug Mode](/how-tos/microservices/running-locally.md#debug-the-application)), and open the [Swagger UI](/how-tos/microservices/running-locally.md#use-the-application)

Click **Authorize** and paste the token, and invoke an endpoint with the padlock icon.

If you've set a breakpoint, you can see that the `httpRequest.user` is populated with the user's identity.

![](/files/aDx4KFuKYJipk2xF357G) ![](/files/jYmT7xLg9DP3CHG22Bbj) ![](/files/Q3PaTQ3y7p52SJAo8LR0) ![](/files/TbciJ1pFYYVnZf1iji8C) ![](/files/fW0gpR4nYHN7gorhTG28)
