Search in sources :

Example 21 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisProxyGrantingTicketServices method store.

@Override
public void store(String ticketId, Ticket ticket, int validitySeconds) {
    RedisConnection conn = connectionFactory.getConnection();
    conn.setexObject(PREFIX + ticketId, validitySeconds, ticket);
    conn.close();
}
Also used : RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Example 22 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisTicketServices method remove.

@Override
public Ticket remove(String ticketId) {
    RedisConnection conn = connectionFactory.getConnection();
    Ticket ticket = conn.getObject(prefixTicketId(ticketId));
    conn.delete(prefixTicketId(ticketId));
    conn.close();
    return ticket;
}
Also used : Ticket(org.maxkey.authz.cas.endpoint.ticket.Ticket) RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Example 23 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisTicketServices method get.

@Override
public Ticket get(String ticketId) {
    RedisConnection conn = connectionFactory.getConnection();
    Ticket ticket = conn.getObject(prefixTicketId(ticketId));
    conn.close();
    return ticket;
}
Also used : Ticket(org.maxkey.authz.cas.endpoint.ticket.Ticket) RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Example 24 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisTicketGrantingTicketServices method get.

@Override
public Ticket get(String ticketId) {
    RedisConnection conn = connectionFactory.getConnection();
    Ticket ticket = conn.getObject(PREFIX + ticketId);
    conn.close();
    return ticket;
}
Also used : Ticket(org.maxkey.authz.cas.endpoint.ticket.Ticket) RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Example 25 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisTicketGrantingTicketServices method store.

@Override
public void store(String ticketId, Ticket ticket, int validitySeconds) {
    RedisConnection conn = connectionFactory.getConnection();
    conn.setexObject(PREFIX + ticketId, validitySeconds, ticket);
    conn.close();
}
Also used : RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Aggregations

RedisConnection (org.maxkey.persistence.redis.RedisConnection)31 Ticket (org.maxkey.authz.cas.endpoint.ticket.Ticket)6 OAuth2AccessToken (org.maxkey.authz.oauth2.common.OAuth2AccessToken)4 ExpiringOAuth2RefreshToken (org.maxkey.authz.oauth2.common.ExpiringOAuth2RefreshToken)3 OAuth2Authentication (org.maxkey.authz.oauth2.provider.OAuth2Authentication)3 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 OAuth2RefreshToken (org.maxkey.authz.oauth2.common.OAuth2RefreshToken)2 OneTimePassword (org.maxkey.password.onetimepwd.OneTimePassword)2 DateTime (org.joda.time.DateTime)1