
one.credify.sdk.OidcService Maven / Gradle / Ivy
package one.credify.sdk;
import com.fasterxml.jackson.core.JsonProcessingException;
import one.credify.sdk.dto.OidcOptions;
import one.credify.sdk.dto.OidcResponse;
import one.credify.sdk.model.UserOidcInfo;
import java.io.IOException;
import java.security.*;
import java.util.Map;
public interface OidcService {
/**
* initiateOIDC
* This generates an ephemeral encryption private key and OIDC URL.
*
* @param consumerId String - OIDC client ID
* @param redirectUrl String - registered redirect URL
* @param scopes String[] - requested scope list
* @param options OIDCRequest - options for this function
* @return OIDCResponse
*/
OidcResponse initiateOidc(String consumerId, String redirectUrl, String[] scopes, OidcOptions options) throws NoSuchAlgorithmException, NoSuchProviderException, JsonProcessingException;
/**
* This manages OpenID Connect token API, generating a new access token from an authorization code. This is a helper function when you use an authorization flow.
* @param consumerId
* @param code
* @param redirectUri
* @return
* @throws IOException
* @throws NoSuchAlgorithmException
* @throws SignatureException
* @throws InvalidKeyException
*/
Map generateAccessToken(String consumerId, String code, String redirectUri) throws IOException, NoSuchAlgorithmException, SignatureException, InvalidKeyException;
/**
* This manages OpenID Connect userinfo API. This needs either a static key or an ephemeral private key that is generated in the above step, and returns decrypted user information. Note that private key needs to be base64 URL encoded string value.
* @param accessToken
* @param privateKey
* @return
* @throws Exception
*/
UserOidcInfo getUserInfo(String accessToken, String privateKey) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy