private void addCredentials ( String accessId ) throws Exception { temporarySubject = new Subject ( ) ; Hashtable < String , Object > hashtable = new Hashtable < String , Object > ( ) ; hashtable . put ( AttributeNameConstants . WSCREDENTIAL_UNIQUEID , AccessIdUtil . getUniqueId ( accessId ) ) ; temporarySubject . getPublicCredentials ( ) . add ( hashtable ) ; setWSPrincipal ( temporarySubject , username , accessId , WSPrincipal . AUTH_METHOD_CERTIFICATE ) ; setCredentials ( temporarySubject , username , username ) ; temporarySubject . getPublicCredentials ( ) . remove ( hashtable ) ; }
Add unique ID and call setPrincipalAndCredentials