jwtgg

command module
v0.0.0-...-bfbd2cf Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 12 Imported by: 0

README

jwtgg

This is a test project for generating a JWT token for testing the integration with the maskinporten.

Generate a key pair for testing
  1. Using flow cli

    # generate a key pair
    flow crypto genrsa --jwk
    
  2. Using the openssl command line tool

    # generate a private key
    openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048
    
    # generate a public key
    openssl rsa -pubout -in private_key.pem -out public_key.pem
    
Configure the integration
```shell
# create a new integration in the samarbeidsportalen, follow documentation like in https://autosys-kjoretoy-api.atlas.vegvesen.no/api-ui/index-maskinporten-konsument.html
# copy the client_id and the client_secret to the .env file
# copy the public key to the integration in the samarbeidsportalen
# update the .env file with the correct values
cp example.env .env
```
Run the application
```shell
# install dependencies
go mod download

# run for get token information
go run main.go

# run for get token information and vechicle information from the svv api
go run main.go -svv
```
Notes

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