Skip to content

torleifg/maskinporten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maskinporten

Prerequisites

  • Test and/or production Maskinporten Client
  • Test and/or production JWKS file or PKCS #12 file (Buypass or Commfides)

Installation

Clone repository and install artifact in Maven local repository.

Usage

<dependency>
  <groupId>com.github.torleifg</groupId>
  <artifactId>maskinporten-client</artifactId>
  <version>0.1.0-SNAPSHOT</version>
</dependency>

JWKS

import com.github.torleifg.maskinporten.MaskinportenClient;

public class Application {
    public static void main(String[] args) {
        final MaskinportenClient client = MaskinportenJwksClient.builder()
                .wellKnown("https://ver2.maskinporten.no/")
                .clientId(clientId)
                .jwks(jwks)
                .kid(kid)
                .cache(false)
                .build();

        client.getAccessToken(scope).ifPresent(System.out::println);
    }
}

X509

import com.github.torleifg.maskinporten.MaskinportenClient;

public class Application {
    public static void main(String[] args) {
        final MaskinportenClient client = MaskinportenX509Client.builder()
                .wellKnown("https://ver2.maskinporten.no/")
                .clientId(clientId)
                .certificate(x509Certificate)
                .key(privateKey)
                .cache(false)
                .build();

        client.getAccessToken(scope).ifPresent(System.out::println);
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages