|
GridGain 4.3.1e
Enterprise "Big Data" Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridgain.grid.spi.GridSpiAdapter
org.gridgain.grid.spi.authentication.jaas.GridJaasAuthenticationSpi
@GridSpiInfo(author="GridGain Systems",
url="www.gridgain.com",
email="support@gridgain.com",
version="4.3.1e.10112012")
@GridSpiMultipleInstancesSupport(value=true)
public class GridJaasAuthenticationSpiJAAS-based implementation of the authentication SPI.
On authentication request this SPI delegates authentication to the externally configured JAAS login module in accordance with JAAS Reference Guide:
GridJaasCallbackHandlerFactory,
which provides subject credentials in format acceptable by the JAAS login module.
GridJaasAuthenticationSpi.setCallbackHandlerFactory(GridJaasCallbackHandlerFactory))GridJaasAuthenticationSpi.setLoginContextName(String))
GridJaasAuthenticationSpi authSpi = getSpi();
// Override JAAS login context name.
authSpi.setLoginContextName("GridJaasLoginContext");
// Override callback handler's factory.
authSpi.setCallbackHandlerFactory(new GridJaasCallbackHandlerFactorySample());
GridConfigurationAdapter cfg = new GridConfigurationAdapter();
// Override default authentication SPI.
cfg.setAuthenticationSpi(authSpi);
// Start grid.
GridFactory.start(cfg);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
...
<property name="authenticationSpi">
<bean class="org.gridgain.grid.spi.authentication.jaas.GridJaasAuthenticationSpi">
<property name="loginContextName" value="GridJaasLoginContext"/>
<property name="callbackHandlerFactory">
<bean class="org.gridgain.grid.spi.authentication.jaas.GridJaasCallbackHandlerFactorySample"/>
</property>
</bean>
</property>
...
</bean>
For information about Spring framework visit www.springframework.org
![]() |
![]() |
| Constructor Summary | |
|---|---|
GridJaasAuthenticationSpi()
|
|
| Method Summary | |
|---|---|
boolean |
authenticate(GridSecuritySubjectType subjType,
byte[] subjId,
Object creds)
Authenticates a given subject (either node or remote client). |
String |
getCallbackHandlerFactoryFormatted()
Gets JAAS-authentication callback handler factory name. |
String |
getLoginContextName()
Gets login context name. |
void |
setCallbackHandlerFactory(GridJaasCallbackHandlerFactory callbackHndFactory)
Sets JAAS-implementation specific callback handler factory. |
void |
setLoginContextName(String loginCtxName)
Sets new login context name. |
void |
spiStart(String gridName)
This method is called to start SPI. |
void |
spiStop()
This method is called to stop SPI. |
boolean |
supported(GridSecuritySubjectType subjType)
Checks if given subject is supported by this SPI. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.gridgain.grid.spi.GridSpi |
|---|
getName, getNodeAttributes, onContextDestroyed, onContextInitialized |
| Methods inherited from interface org.gridgain.grid.spi.GridSpiJsonConfigurable |
|---|
setJson |
| Methods inherited from interface org.gridgain.grid.spi.GridSpiManagementMBean |
|---|
getAuthor, getGridGainHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion |
| Constructor Detail |
|---|
public GridJaasAuthenticationSpi()
| Method Detail |
|---|
public String getLoginContextName()
getLoginContextName in interface GridJaasAuthenticationSpiMBean@GridSpiConfiguration(optional=true) public void setLoginContextName(String loginCtxName)
setLoginContextName in interface GridJaasAuthenticationSpiMBeanloginCtxName - New login context name.public String getCallbackHandlerFactoryFormatted()
getCallbackHandlerFactoryFormatted in interface GridJaasAuthenticationSpiMBean@GridSpiConfiguration(optional=false) public void setCallbackHandlerFactory(GridJaasCallbackHandlerFactory callbackHndFactory)
callbackHndFactory - JAAS-implementation specific callback handler factory.
public boolean authenticate(GridSecuritySubjectType subjType,
byte[] subjId,
@Nullable
Object creds)
throws GridSpiException
authenticate in interface GridAuthenticationSpiGridSpiException - If authentication resulted in system error.
Note that bad credentials should not cause this exception.subjType - Subject type.subjId - Unique subject ID such as local or remote node ID, client ID, etc.creds - Authentication parameters (may be null or empty based on implementation).
The map of parameters may be different for different subject types. Refer to specific
authentication SPI documentation for a list of required parameters.
true if authentication passed, false if authentication failed.public boolean supported(GridSecuritySubjectType subjType)
supported in interface GridAuthenticationSpisubjType - Subject type.
True if subject type is supported, false otherwise.
public void spiStart(String gridName)
throws GridSpiException
spiStart in interface GridSpiGridSpiException - Throws in case of any error during SPI start.gridName - Name of grid instance this SPI is being started for
(null for default grid).
public void spiStop()
throws GridSpiException
Note that this method can be called at any point including during recovery of failed start. It should make no assumptions on what state SPI will be in when this method is called.
spiStop in interface GridSpiGridSpiException - Thrown in case of any error during SPI stop.public String toString()
toString in class Object
|
GridGain 4.3.1e
Enterprise "Big Data" Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - In-Memory Big Data
|
|
|