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

io.imunity.console.views.authentication.realms.AuthenticationRealmEntry Maven / Gradle / Ivy

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

package io.imunity.console.views.authentication.realms;

import pl.edu.icm.unity.base.authn.AuthenticationRealm;
import pl.edu.icm.unity.base.authn.RememberMePolicy;

import java.util.Collections;
import java.util.List;

class AuthenticationRealmEntry
{
	private static final int DEFAULT_ALLOW_FOR_REMEMBER_ME_DAYS = 14;
	private static final int DEFAULT_BLOCK_FOR = 60;
	private static final int DEFAULT_MAX_INACTIVITY = 1800;
	private static final int DEFAULT_BLOCK_AFTER_UNSUCCESSFUL_LOGINS = 5;

	final AuthenticationRealm realm;
	final List endpoints;

	public AuthenticationRealmEntry()
	{
		this.realm = new AuthenticationRealm();
		realm.setAllowForRememberMeDays(DEFAULT_ALLOW_FOR_REMEMBER_ME_DAYS);
		realm.setBlockFor(DEFAULT_BLOCK_FOR);
		realm.setMaxInactivity(DEFAULT_MAX_INACTIVITY);
		realm.setBlockAfterUnsuccessfulLogins(DEFAULT_BLOCK_AFTER_UNSUCCESSFUL_LOGINS);
		realm.setRememberMePolicy(RememberMePolicy.allowFor2ndFactor);
		this.endpoints = List.of();
	}

	AuthenticationRealmEntry(AuthenticationRealm realm, List endpoints)
	{
		this.realm = realm;
		this.endpoints = Collections.unmodifiableList(endpoints == null ? Collections.emptyList() : endpoints);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy