Skip to content
/ jwtgg Public

The `jwtgg` repository is a Go-based project primarily used for the generation of JSON Web Tokens (JWTs). This tool aids in testing integrations with the [Maskinporten service](https://www.digdir.no/), a platform maintained by the Norwegian Digitalisation Agency designed to facilitate secure data exchanges between organizations.

License

Notifications You must be signed in to change notification settings

flow-lab/jwtgg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

The `jwtgg` repository is a Go-based project primarily used for the generation of JSON Web Tokens (JWTs). This tool aids in testing integrations with the [Maskinporten service](https://www.digdir.no/), a platform maintained by the Norwegian Digitalisation Agency designed to facilitate secure data exchanges between organizations.

Topics

Resources

License

Stars

Watchers

Forks

Languages