samples-golang

command module
v0.0.0-...-72f4954 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 11 Imported by: 0

README

Golang code samples for Crossid

This repo demonstrates how to integrate Golang with Crossid.

Prerequisites
  1. Tell Crossid about your app.
  2. Setup HTTPS (see below)

App params example:

"client_name": "foo",
"client_secret": "foobar",
"client_id": "myapp",
"redirect_uris": ["https://localhost/callback"],
"audience": ["https://localhost"]
Setup HTTPS

To avoid security issues, this sample is expected to be exposed with HTTPS.

Lets use Caddy to route traffic from port 443 to 3000.

caddy reverse-proxy --from localhost:443 --to localhost:3000
Run the app
git clone https://github.com/crossid/samples-golang
cd samples-golang

# Replace <TENANT> with your crossid tenant
go run . --issuerBaseURL=https://<TENANT>.crossid.io/api/v1/oauth2/authorization-servers/default --port 3005 --client-id myapp --client-secret foobar --audience https://localhost

Browser should be opened automatically.

New to Crossid? check out the get started guide

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL