Search in sources :

Example 6 with TokenRestriction

use of com.iplanet.dpro.session.TokenRestriction in project OpenAM by OpenRock.

the class JSONSerialisationTest method tokenRestrictionDeserialisationWithTypeWorks.

@Test
public void tokenRestrictionDeserialisationWithTypeWorks() throws Exception {
    InternalSession is = serialization.deserialise(getJSON("/json/basic-session-with-restriction.json"), InternalSession.class);
    assertThat(is).isNotNull();
    TokenRestriction restriction = is.getRestrictionForToken(new SessionID("AQIC5wM2LY4SfcyTLz6VjQ7nkFeDcEh8K5dXkIE" + "NpXlpg28.*AAJTSQACMDIAAlMxAAIwMQACU0sAEzc5ODIzMDM5MzQyNzU2MTg1NDQ.*"));
    assertThat(restriction).isNotNull().isInstanceOf(DNOrIPAddressListTokenRestriction.class);
    assertThat(restriction.toString().equals("Fzy2GsI/O1TsXhvlVuqjqIuTG2k="));
    assertThat(is.getSessionHandle()).isNotNull().isEqualTo("shandle:weasel");
}
Also used : DNOrIPAddressListTokenRestriction(com.iplanet.dpro.session.DNOrIPAddressListTokenRestriction) TokenRestriction(com.iplanet.dpro.session.TokenRestriction) InternalSession(com.iplanet.dpro.session.service.InternalSession) SessionID(com.iplanet.dpro.session.SessionID) Test(org.testng.annotations.Test)

Aggregations

TokenRestriction (com.iplanet.dpro.session.TokenRestriction)6 SessionException (com.iplanet.dpro.session.SessionException)4 SessionID (com.iplanet.dpro.session.SessionID)3 IOException (java.io.IOException)2 JsonSetter (com.fasterxml.jackson.annotation.JsonSetter)1 DNOrIPAddressListTokenRestriction (com.iplanet.dpro.session.DNOrIPAddressListTokenRestriction)1 Session (com.iplanet.dpro.session.Session)1 SessionTimedOutException (com.iplanet.dpro.session.SessionTimedOutException)1 InternalSession (com.iplanet.dpro.session.service.InternalSession)1 SessionInfo (com.iplanet.dpro.session.share.SessionInfo)1 SSOException (com.iplanet.sso.SSOException)1 FSException (com.sun.identity.federation.common.FSException)1 FSAssertion (com.sun.identity.federation.message.FSAssertion)1 FSAuthnResponse (com.sun.identity.federation.message.FSAuthnResponse)1 FSMsgException (com.sun.identity.federation.message.common.FSMsgException)1 SAMLException (com.sun.identity.saml.common.SAMLException)1 Status (com.sun.identity.saml.protocol.Status)1 StatusCode (com.sun.identity.saml.protocol.StatusCode)1 DataInputStream (java.io.DataInputStream)1 DataOutputStream (java.io.DataOutputStream)1