docs(OpenAPIConfiguration): update authentication description format
This commit is contained in:
parent
bd30f6ba74
commit
e237e5741e
@ -1,7 +1,6 @@
|
|||||||
package de.szut.lf8_starter.config;
|
package de.szut.lf8_starter.config;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.Components;
|
import io.swagger.v3.oas.models.Components;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
@ -33,15 +32,33 @@ public class OpenAPIConfiguration {
|
|||||||
.addServersItem(new Server().url(this.context.getContextPath()))
|
.addServersItem(new Server().url(this.context.getContextPath()))
|
||||||
.info(new Info()
|
.info(new Info()
|
||||||
.title("LF8 project starter")
|
.title("LF8 project starter")
|
||||||
.description("\n## Auth\n" +
|
.description("""
|
||||||
"\n## Authentication\n" + "\nThis Hello service uses JWTs to authenticate requests. You will receive a bearer token by making a POST-Request in IntelliJ on:\n\n" +
|
## Auth
|
||||||
"\n" +
|
|
||||||
"```\nPOST http://keycloak.szut.dev/auth/realms/szut/protocol/openid-connect/token\nContent-Type: application/x-www-form-urlencoded\ngrant_type=password&client_id=employee-management-service&username=user&password=test\n```\n" +
|
## Authentication
|
||||||
"\n" +
|
|
||||||
"\nor by CURL\n" +
|
This Hello service uses JWTs to authenticate requests. You will receive a bearer token by making a POST-Request in IntelliJ on:
|
||||||
"```\ncurl -X POST 'http://keycloak.szut.dev/auth/realms/szut/protocol/openid-connect/token'\n--header 'Content-Type: application/x-www-form-urlencoded'\n--data-urlencode 'grant_type=password'\n--data-urlencode 'client_id=employee-management-service'\n--data-urlencode 'username=user'\n--data-urlencode 'password=test'\n```\n" +
|
|
||||||
"\nTo get a bearer-token in Postman, you have to follow the instructions in \n [Postman-Documentation](https://documenter.getpostman.com/view/7294517/SzmfZHnd).")
|
```
|
||||||
|
POST http://keycloak.szut.dev/auth/realms/szut/protocol/openid-connect/token
|
||||||
|
Content-Type: application/x-www-form-urlencoded
|
||||||
|
grant_type=password&client_id=employee-management-service&username=user&password=test
|
||||||
|
```
|
||||||
|
|
||||||
|
or by CURL:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -X POST 'http://keycloak.szut.dev/auth/realms/szut/protocol/openid-connect/token'
|
||||||
|
--header 'Content-Type: application/x-www-form-urlencoded'
|
||||||
|
--data-urlencode 'grant_type=password'
|
||||||
|
--data-urlencode 'client_id=employee-management-service'
|
||||||
|
--data-urlencode 'username=user'
|
||||||
|
--data-urlencode 'password=test'
|
||||||
|
```
|
||||||
|
|
||||||
|
To get a bearer-token in Postman, you have to follow the instructions in
|
||||||
|
[Postman-Documentation](https://documenter.getpostman.com/view/7294517/SzmfZHnd).
|
||||||
|
""")
|
||||||
.version("0.1"))
|
.version("0.1"))
|
||||||
.addSecurityItem(new SecurityRequirement().addList(securitySchemeName))
|
.addSecurityItem(new SecurityRequirement().addList(securitySchemeName))
|
||||||
.components(
|
.components(
|
||||||
|
Loading…
Reference in New Issue
Block a user