{"repo":"felleslosninger/jwt-grant-generator","free":true,"listed":false,"github":"https://github.com/felleslosninger/jwt-grant-generator","clone":"git clone https://github.com/felleslosninger/jwt-grant-generator.git","description":"Example code in java on how to generate jwt-grants used to retrieve tokens for accessing Maskinporten protected APIs","language":"Java","stars":20,"topics":["java","jwt","maskinporten","team-idporten","testing-tool"],"license":null,"category":"auth-billing-email","readme_excerpt":"jwt-grant-generator This project demonstrates how clients of Maskinporten can make a jwt grant used to retrieve tokens for accessing services like Kontakt- og reservasjonsregisteret REST-API or ID-porten self-service APIs. Before you can retrieve any tokens you need to be a customer of Digdir and have a client registration, see https://samarbeid.digdir.no It is important to understand the authorization flow used for these apis, see https://docs.digdir.no/docs/Maskinporten/maskinporten guide apikonsument Note: The access token is only retrieved if an token.endpoint property is given. Without this a jwt bearer grant will only be printed. For questions, please contact servicedesk@digdir.no Client configuration To generate a jwt-grant you need a property file holding your client configuration: To use base64-encoded keystore, use: To also retrieve an access-token from an authorization server, add this property to the properties file: If you want to generate a token utilising the delegation capabilities in Maskinporten, add this property to the properties file: You may authenticate with a self-signed certificate if your client in Maskinporten holds a JSON Web Key Set with your public key, simply add your key ID to the properties file: Authorization details will be decoded, and can contain more than one, so that each makes a separate authorization details. Using sub-values (like systemuser org) creates sub object in jwt, the example config above will be included like this: Usage To ","default_branch":null,"files":null,"tree":[],"storefront":"/r/felleslosninger","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/felleslosninger/jwt-grant-generator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}