Skip to content

Commit

Permalink
Use dotenv to load Okta settings (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Raible authored Jan 26, 2022
1 parent ddaf7a8 commit 761ab01
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .okta.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ISSUER=${CLI_OKTA_ISSUER}
CLIENT_ID=${CLI_OKTA_CLIENT_ID}
CLIENT_SECRET=${CLI_OKTA_CLIENT_SECRET}
5 changes: 3 additions & 2 deletions .okta/sample-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ oauthClient:
applicationType: web

directions: |+2
Okta configuration written to: src/main/resources/application.properties
Don't EVER commit src/main/resources/application.properties into source control
Okta configuration written to .okta.env.
Add this file to .gitignore!
Run this application with:
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<artifactId>okta-spring-boot-starter</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>me.paulschwarz</groupId>
<artifactId>spring-dotenv</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
okta.oauth2.issuer=${CLI_OKTA_ISSUER}
okta.oauth2.client-id=${CLI_OKTA_CLIENT_ID}
okta.oauth2.client-secret=${CLI_OKTA_CLIENT_SECRET}
okta.oauth2.issuer=${env.ISSUER}
okta.oauth2.client-id=${env.CLIENT_ID}
okta.oauth2.client-secret=${env.CLIENT_SECRET}
.env.filename=.okta.env

0 comments on commit 761ab01

Please sign in to comment.