This microservice runs an OAuth2 authorization server.
Remember that since tokens are exposed to the network, they must be transported securely through HTTPS.
Read the following materials to get an introduction of how OAuth2 works:
- From Digital Ocean: https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2
If you want to test with Postman, you can use the following data:
- Callback URL:
- Token Name: <Set by you, any name is Ok>
- Auth(orization) URL: http://localhost:11001/uaa/oauth/authorize <---> http://localhost:8888/uaa/oauth/authorize
- Access Token URL: http://localhost:11001/uaa/oauth/authorize <---> http://localhost:8888/uaa/oauth/authorize
- Client ID: app
- Client secret: app-secret-password (doesn't make much sense because we're using a SPA so it's sort of public)
- Scope:
- Grant Type: Authorization Code
-
Install Docker and run the terminal for the following image (Optional). Alternatively you can try to run the commands directly in your OS (if not Windows).
docker run -ti -v ~/tmp:/data java:8
-
Generate the certificate. Change the dname and password if necessary.
keytool -genkeypair -alias jwt -keyalg RSA -dname "CN=jwt, OU=Internal Projects, O=GFT, L=La Aurora, S=Heredia, C=CR" -keypass mySecretKey -keystore /data/jwt.jks -storepass mySecretKey && echo "mySecretKey" | keytool -list -rfc --keystore /data/jwt.jks | openssl x509 -inform pem -pubkey > /data/public-key.pem