public class Id4meLogon
extends java.lang.Object
Id4meSessionData
Constructor and Description |
---|
Id4meLogon(java.lang.String id4me_properties_file,
java.lang.String claims_parameters_file)
Read the configuration files and initialize the local variables needed
to perform an ID4me logon flow.
|
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(Id4meSessionData session_data,
java.lang.String code)
Gets the access-token from the identity authority and stores it into the
Id4meSessionData |
java.lang.String |
authorize(Id4meSessionData session_data)
Returns the Id4ME authentication request uri.
|
Id4meSessionData |
createSessionData(java.lang.String id4me,
boolean autoRegisterClient)
Create a new
Id4meSessionData object for a give id4me. |
boolean |
doDynamicClientRegistration(Id4meSessionData session_data)
Do a dynamic client registration for the relying party at the InetId's
identity authority and save the registration data in the local registration
storage.
|
boolean |
registerClient(Id4meSessionData session_data)
Does the dynamic client registration and stores the registration data into as
JSON string in a text file
|
boolean |
unsubscribeIau(Id4meSessionData session_data)
Unsubscribes the relying party at the identity authority and removes the
registration data from the local storage.
|
boolean |
userinfo(Id4meSessionData session_data)
Get the userinfo from the userinfo_endpoint which is in the
.well-known data from the identity authority. |
public Id4meLogon(java.lang.String id4me_properties_file, java.lang.String claims_parameters_file) throws java.lang.Exception
id4me_properties_file
- contains the properties needed for the client registrationclaims_parameters_file
- contains the claims configuration in json formatjava.lang.Exception
public Id4meSessionData createSessionData(java.lang.String id4me, boolean autoRegisterClient) throws java.lang.Exception
Id4meSessionData
object for a give id4me. If the client
is not already registered at the identity authority the dynamic client
registration can be done implicitilyid4me
- The id4me for this session.autoRegisterClient
- Flag, indicating whether the client shall be automatically
registered, if not already done.java.lang.Exception
- In case of errorpublic boolean unsubscribeIau(Id4meSessionData session_data)
session_data
- Id4meSessionData
the current Id4ME session objectpublic boolean doDynamicClientRegistration(Id4meSessionData session_data) throws java.lang.Exception
session_data
- Id4meSessionData
the current Id4ME session objectjava.lang.Exception
- if getRegistrationData or storage.saveRegistrationData throws anypublic java.lang.String authorize(Id4meSessionData session_data) throws java.io.UnsupportedEncodingException
session_data
- Id4meSessionData
the current Id4ME session objectjava.io.UnsupportedEncodingException
- if the encoding of the parameter claims failspublic boolean authenticate(Id4meSessionData session_data, java.lang.String code) throws java.lang.Exception
Id4meSessionData
session_data
- Id4meSessionData
the current Id4ME session objectcode
- The code parameter, received by the redirect of the
authorize
callTokenNotFoundException
- if no bearer token is found in the access-token or Exception
if getToken(Id4meSessionData, String)
throws one.java.lang.Exception
public boolean userinfo(Id4meSessionData session_data) throws java.lang.Exception
.well-known
data from the identity authority. If the
userinfo_endpoint is a json object with the members _claim_names and
_claim_sources, the userinfo gets discovered via the distributed claims
mechanism.
openid-connect-core-1_0.html#AggregatedDistributedClaims
session_data
- Id4meSessionData
the current Id4ME session objectMandatoryClaimsException
- if any mandatory claim is missing or an Exception if
getUserinfo() throws onejava.lang.Exception
public boolean registerClient(Id4meSessionData session_data) throws java.lang.Exception
session_data
- Id4meSessionData
the current Id4ME session objectjava.lang.Exception
- from: