adfs-auth-client

Java client for authentication against active directory federation service(ADFS) - SAML,JWT,BST

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

com.github.itzmedinesh
Идентификатор

Идентификатор

adfs-auth-client
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

pom
Описание

Описание

adfs-auth-client
Java client for authentication against active directory federation service(ADFS) - SAML,JWT,BST
Ссылка на сайт

Ссылка на сайт

https://github.com/itzmedinesh/adfs-auth-client.git
Система контроля версий

Система контроля версий

https://github.com/itzmedinesh/adfs-auth-client

Скачать adfs-auth-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.itzmedinesh/adfs-auth-client/ -->
<dependency>
    <groupId>com.github.itzmedinesh</groupId>
    <artifactId>adfs-auth-client</artifactId>
    <version>1.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.itzmedinesh/adfs-auth-client/
implementation 'com.github.itzmedinesh:adfs-auth-client:1.0.0'
// https://jarcasting.com/artifacts/com.github.itzmedinesh/adfs-auth-client/
implementation ("com.github.itzmedinesh:adfs-auth-client:1.0.0")
'com.github.itzmedinesh:adfs-auth-client:pom:1.0.0'
<dependency org="com.github.itzmedinesh" name="adfs-auth-client" rev="1.0.0">
  <artifact name="adfs-auth-client" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.itzmedinesh', module='adfs-auth-client', version='1.0.0')
)
libraryDependencies += "com.github.itzmedinesh" % "adfs-auth-client" % "1.0.0"
[com.github.itzmedinesh/adfs-auth-client "1.0.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
javax.xml.bind : jaxb-api jar 2.2.7
com.sun.xml.bind : jaxb-core jar 2.2.7
com.sun.xml.bind : jaxb-impl jar 2.2.7-b41

Модули Проекта

Данный проект не имеет модулей.

adfs-auth-client

Java client for authentication against active directory federation service(ADFS) - SAML,JWT,BST

Versions on maven

http://central.maven.org/maven2/com/github/itzmedinesh/adfs-auth-client/

Create ADFS SignOn request


SignOnService signOnService = new SignOnServiceImpl();

1. SAML assertion token
                    
String authRequest = signOnService.createSignOnRequest(domain+"\\"+mUsername, mPassword,
                        SignOnService.TokenTypes.SAML_TOKEN_TYPE);
2. Binary security token

String authRequest = signOnService.createSignOnRequest(domain+"\\"+mUsername, mPassword,
                        SignOnService.TokenTypes.BST_TOKEN_TYPE);	
3. Json Web Token

String authRequest = signOnService.createSignOnRequest(domain+"\\"+mUsername, mPassword,
                        SignOnService.TokenTypes.JWT_TOKEN_TYPE);               

Initialization of java rest client to access SignOn token from ADFS authentication endpoint


Add the rest-api-client library dependency into your project from : https://mvnrepository.com/artifact/com.github.itzmedinesh/rest-api-client

Initialize the ADFS endpoint access client template:

String loginSvcUrlTemplate = "{\"url.hostname\":\"sts.test.com\",\"url.port\":\"80\",\"url.resource.path\":\"/adfs/services/trust/13/usernamemixed\",\"url.ssl.enabled\":\"true\"}";

ServiceUrlConfig authSvcUrlConfig = objectMapper.readValue(loginSvcUrlTemplate, ServiceUrlConfig.class);

RestClientTemplate restClientTemplateTemp = new RestServiceClient().createClientTemplate("LOGIN_ACCESS_TOKEN", authSvcUrlConfig);

Entity<String> postCallInput = Entity.entity(authRequest, "application/soap+xml; charset=utf-8");

String loginresponse = restClientTemplateTemp.create(null, null, postCallInput).readEntity(String.class);

Extract SignOn token


1. SAML assertion token
                    
	Assertion samlAssertion = signOnService.getSamlToken(loginresponse);

2. Binary security token

	BinarySecurityToken bst = signOnService.getBinarySecurityToken(loginresponse);
	
3. Json Web Token

	String jwt = signOnService.getJsonWebToken(loginresponse);	
								

Версии библиотеки

Версия
1.0.0