-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize code to improve importing
- Loading branch information
1 parent
130f61f
commit a268cb8
Showing
13 changed files
with
62 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Duo Universal Golang SDK Demo | ||
|
||
A simple Go web application that serves a logon page integrated with Duo 2FA. | ||
|
||
## Setup | ||
Change to the "example" directory | ||
``` | ||
cd example | ||
``` | ||
|
||
Install the demo requirements: | ||
``` | ||
go mod tidy | ||
``` | ||
|
||
Then, create a `Web SDK` application in the Duo Admin Panel. See https://duo.com/docs/protecting-applications for more details. | ||
|
||
## Using the App | ||
|
||
1. Copy the Client ID, Client Secret, and API Hostname values for your `Web SDK` application into the `duo_config.json` file. | ||
1. Start the app. | ||
``` | ||
go run main.go | ||
``` | ||
1. Navigate to http://localhost:8080. | ||
1. Log in with the user you would like to enroll in Duo or with an already enrolled user (any password will work). | ||
## (Optional) Run the demo using docker | ||
A dockerfile is included to easily run the demo app with a known working Go configuration. | ||
1. Copy the Client ID, Client Secret, and API Hostname values for your `Web SDK` application into the `duo_config.json` file. | ||
1. Build the docker image: `docker build -t duo_golang_example .` | ||
1. Run the docker container `docker run -p 8080:8080 duo_golang_example` | ||
1. Navigate to http://localhost:8080. | ||
1. Log in with the user you would like to enroll in Duo or with an already enrolled user (any password will work). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM golang:latest | ||
EXPOSE 8080 | ||
WORKDIR /go/src/app | ||
ADD . . | ||
|
||
RUN go mod tidy | ||
|
||
WORKDIR /go/src/app/example | ||
ENTRYPOINT ["go", "run", "main.go"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/duosecurity/duo_universal_golang | ||
|
||
go 1.16 | ||
|
||
require github.com/lestrrat-go/jwx v1.2.4 |