Skip to content

Commit

Permalink
properties intead of yaml (#1430)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo authored Feb 5, 2024
1 parent 60a0faa commit 18a9b7d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 42 deletions.
2 changes: 1 addition & 1 deletion guides/micronaut-security-jwt/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"apps": [
{
"name": "default",
"features": ["yaml", "security-jwt", "data-jdbc", "reactor", "graalvm", "validation"]
"features": ["security-jwt", "data-jdbc", "reactor", "graalvm", "validation"]
}
]
}
8 changes: 3 additions & 5 deletions guides/micronaut-security-jwt/micronaut-security-jwt.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ common:create-app-features.adoc[]

=== Configuration

Note the following configuration in the generated `application.yml`:
Note the following configuration in the generated `application.properties`:

common:yaml-dependency.adoc[]

resource:application.yml[tag=security]
resource:application.properties[tag=security]

<1> Set `authentication` to `bearer` to receive a JSON response from the login endpoint.
<2> Change this to your own secret and keep it safe (do not store this in your VCS).
Expand Down Expand Up @@ -83,7 +81,7 @@ Access tokens expire. You can control the expiration with `micronaut.security.to

First, add the following configuration:

resource:application.yml[tag=refresh]
resource:application.properties[tag=refresh]

<1> To generate a refresh token your application must have beans of type:
https://micronaut-projects.github.io/micronaut-security/latest/api/io/micronaut/security/token/generator/RefreshTokenGenerator.html[RefreshTokenGenerator],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
micronaut.application.name=micronautguide
#tag::security[]
# <1>
micronaut.security.authentication=bearer
# <2>
micronaut.security.token.jwt.signatures.secret.generator.secret="${JWT_GENERATOR_SIGNATURE_SECRET:pleaseChangeThisSecretForANewOne}"'
#end::security[]
#tag::refresh[]
# <1>
micronaut.security.token.jwt.generator.refresh-token.secret="${JWT_GENERATOR_SIGNATURE_SECRET:pleaseChangeThisSecretForANewOne}"'
#end::refresh[]
---
#tag::datasources[]
datasources.default.password=
datasources.default.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
datasources.default.username=sa
datasources.default.driver-class-name=org.h2.Driver
datasources.default.schema-generate=CREATE_DROP
datasources.default.dialect=H2
#end::datasource[]
36 changes: 0 additions & 36 deletions guides/micronaut-security-jwt/src/main/resources/application.yml

This file was deleted.

0 comments on commit 18a9b7d

Please sign in to comment.