Class InvocationContext
- java.lang.Object
-
- pl.edu.icm.unity.engine.api.authn.InvocationContext
-
- All Implemented Interfaces:
java.io.Serializable
public class InvocationContext extends java.lang.Object implements java.io.Serializable
Stores thread-local information about the current request metadata in thread local variable. The thread-local variable should be set up by the binding authentication code.The data stored includes authenticated user's identity and the selected locale.
- Author:
- K. Benedyczak
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InvocationContext(pl.edu.icm.unity.types.basic.IdentityTaV tlsIdentity, pl.edu.icm.unity.types.authn.AuthenticationRealm realm, java.util.List<AuthenticationFlow> endpointFlows)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InvocationContext
getCurrent()
java.lang.String
getCurrentURLUsed()
java.util.List<AuthenticationFlow>
getEndpointFlows()
java.util.Locale
getLocale()
LoginSession
getLoginSession()
pl.edu.icm.unity.types.authn.AuthenticationRealm
getRealm()
pl.edu.icm.unity.types.basic.IdentityTaV
getTlsIdentity()
static boolean
hasCurrent()
static java.lang.String
safeGetRealm()
static void
setCurrent(InvocationContext context)
void
setCurrentURLUsed(java.lang.String currentURLUsed)
void
setLocale(java.util.Locale locale)
void
setLoginSession(LoginSession loginSession)
void
setTlsIdentity(pl.edu.icm.unity.types.basic.IdentityTaV tlsIdentity)
Sets a TLS authenticated identity.
-
-
-
Constructor Detail
-
InvocationContext
public InvocationContext(pl.edu.icm.unity.types.basic.IdentityTaV tlsIdentity, pl.edu.icm.unity.types.authn.AuthenticationRealm realm, java.util.List<AuthenticationFlow> endpointFlows)
- Parameters:
tlsIdentity
- TLS client-authenticated identity (of X500 type) or null if there is no TLS client connection context or it is not client authenticated.
-
-
Method Detail
-
setCurrent
public static void setCurrent(InvocationContext context)
-
getCurrent
public static InvocationContext getCurrent() throws pl.edu.icm.unity.exceptions.InternalException
- Throws:
pl.edu.icm.unity.exceptions.InternalException
-
hasCurrent
public static boolean hasCurrent()
-
safeGetRealm
public static java.lang.String safeGetRealm()
- Returns:
- current authentication realm's name or null if undefined/unknown.
-
getRealm
public pl.edu.icm.unity.types.authn.AuthenticationRealm getRealm()
-
getLoginSession
public LoginSession getLoginSession()
-
setLoginSession
public void setLoginSession(LoginSession loginSession)
-
getLocale
public java.util.Locale getLocale()
- Returns:
- the locale
-
setLocale
public void setLocale(java.util.Locale locale)
-
getTlsIdentity
public pl.edu.icm.unity.types.basic.IdentityTaV getTlsIdentity()
- Returns:
- the TLS authenticated identity if available or null
-
setTlsIdentity
public void setTlsIdentity(pl.edu.icm.unity.types.basic.IdentityTaV tlsIdentity)
Sets a TLS authenticated identity.- Parameters:
tlsIdentity
-
-
getEndpointFlows
public java.util.List<AuthenticationFlow> getEndpointFlows()
-
getCurrentURLUsed
public java.lang.String getCurrentURLUsed()
- Returns:
- the current URL which was used to trigger the current processing. Can be null. This is set on best effort basis and is not suitable for authorization or other sensitive operations. Always check if not null.
-
setCurrentURLUsed
public void setCurrentURLUsed(java.lang.String currentURLUsed)
-
-