14.5.11.4. Custom Token Registry
If none of the built-in implementations are useful for you, PicketLink allows you to create your own implementation. To do that, just create a class that implements the org.picketlink.identity.federation.core.sts.registry.SecurityTokenRegistry interface.
Tip
We recommend that you take a look first at one of the provided implementation before building your own.
Bellow is an skeleton for a custom Token Registry implementation:
public class CustomSecurityTokenRegistry implements SecurityTokenRegistry {
@Override
public void addToken(String tokenID, Object token) throws IOException {
// TODO: logic to add a token to the registry
}
@Override
public void removeToken(String tokenID) throws IOException {
// TODO: logic to remove a token to the registry
}
@Override
public Object getToken(String tokenID) {
// TODO: logic to get a token from the registry
return null;
}
}

