All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.imunity.fido.FidoExchange Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
/*
 * Copyright (c) 2020 Bixbit - Krzysztof Benedyczak All rights reserved.
 * See LICENCE.txt file for licensing information.
 */
package io.imunity.fido;

import io.imunity.fido.service.FidoException;
import pl.edu.icm.unity.engine.api.authn.AuthenticationResult;
import pl.edu.icm.unity.engine.api.authn.CredentialExchange;

import java.util.AbstractMap;

/**
 * Handles interaction between Credential Retrieval {@link FidoRetrieval} and Credential Verificator {@link io.imunity.fido.service.FidoCredentialVerificator}.
 * Performs authentication validation.
 *
 * @author R. Ledzinski
 */
public interface FidoExchange extends CredentialExchange
{
	String ID = "fido exchange";

	/**
	 * Create authentication request options that is passed to navigator.credentials.get() method on the client side.
	 *
	 * @param entityId user entity id (nullable)
	 * @param username Username property, existing username or new one. entityId take priority!
	 * @return Request ID and JSON authentication options
	 * @throws FidoException In case of problems with JSON parsing
	 */
	AbstractMap.SimpleEntry getAuthenticationOptions(final Long entityId, final String username) throws FidoException;

	/**
	 * Validates signatures made by Authenticator.
	 *
	 * @param reqId    Authentication request ID
	 * @param jsonBody Authenticator response returned by navigator.credentials.get()
	 * @throws FidoException In case of any authentication problems
	 */
	AuthenticationResult verifyAuthentication(final String reqId, final String jsonBody) throws FidoException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy