android-adfs-client

Android java client for authentication against active directory federation service(ADFS) - JWT,BST

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.github.itzmedinesh
ArtifactId

ArtifactId

android-adfs-client
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

pom
Description

Description

android-adfs-client
Android java client for authentication against active directory federation service(ADFS) - JWT,BST
Project URL

Project URL

https://github.com/itzmedinesh/android-adfs-client.git
Source Code Management

Source Code Management

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

Download android-adfs-client

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.simpleframework : simple-xml jar 2.7.1

Project Modules

There are no modules declared in this project.

android-adfs-client

Android java client for authentication against active directory federation service(ADFS) - JWT,BST

Versions on maven

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

Create ADFS SignOn request


SignOnService signOnService = new SignOnServiceImpl();

1. Binary security token

String authRequest = signOnService.createSignOnRequest(domain+"\\"+mUsername, mPassword,
                        SignOnService.TokenTypes.BST_TOKEN_TYPE);	
2. 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 AndroidRestServiceClient().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. Binary security token

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

	String jwt = signOnService.getJsonWebToken(loginresponse);	
								

Versions

Version
1.0.0