An open API service indexing awesome lists of open source software.

https://github.com/jasonfriedland/asap

A simple client package for ASAP authentication.
https://github.com/jasonfriedland/asap

authentication golang jwt

Last synced: 5 months ago
JSON representation

A simple client package for ASAP authentication.

Awesome Lists containing this project

README

          

asap
====

[![Go Tests](https://github.com/jasonfriedland/asap/actions/workflows/actions.yml/badge.svg)](https://github.com/jasonfriedland/asap/actions)

A simple client package for [ASAP](https://s2sauth.bitbucket.io/) authentication.

Installation
------------

```shell
go get github.com/jasonfriedland/asap
```

Environment Variables
---------------------

```shell
ASAP_PRIVATE_KEY=data:application/pkcs8;kid=webapp%2Fabc123;base64,...
ASAP_ISSUER=services/webapp
ASAP_AUDIENCE=webapp,webapp-service
```

Usage
-----

Ensure the relevant environment variables are set. Then:

```golang
import "github.com/jasonfriedland/asap"

client, _ := asap.NewClient()
token, _ := client.AuthToken()

fmt.Printf("Bearer %s", token)
```