https://github.com/tomcyr/workos-go-authkit-example
GO WORKOS integration example using AuthKit and Fiber
https://github.com/tomcyr/workos-go-authkit-example
authentication authorization go golang
Last synced: 4 months ago
JSON representation
GO WORKOS integration example using AuthKit and Fiber
- Host: GitHub
- URL: https://github.com/tomcyr/workos-go-authkit-example
- Owner: tomcyr
- License: mit
- Created: 2025-02-11T14:29:29.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-26T10:32:21.000Z (4 months ago)
- Last Synced: 2025-02-26T11:33:52.499Z (4 months ago)
- Topics: authentication, authorization, go, golang
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GO WORKOS integration example using AuthKit and Fiber
An example application demonstrating how to authenticate users with AuthKit (https://workos.com) and the WorkOS GO SDK.> Refer to the [User Management](https://workos.com/docs/user-management) documentation for reference.
## Prerequisites
You will need a [WorkOS account](https://dashboard.workos.com/signup).
## Requirements
GO 1.23 (tested)
## Running the example
1. In the [WorkOS dashboard](https://dashboard.workos.com), head to the Redirects tab and create a [sign-in callback redirect](https://workos.com/docs/user-management/1-configure-your-project/configure-a-redirect-uri) for `http://localhost:8080/auth/callback`.
2. After creating the redirect URI, navigate to the API keys tab and copy the _Client ID_ and the _Secret Key_. Rename the `.env.example` file to `.env` and supply your Client ID and API key as environment variables.
3. Verify your `.env` file has the following variables filled.
```bash
WORKOS_CLIENT_ID=
WORKOS_API_KEY=
WORKOS_AUTHKIT_URL=
```4. Install the dependencies
```bash
go get ./...
```5. Run the following command and navigate to [http://localhost:8080](http://localhost:8080).
```bash
go run cmd/web/main.go
```