I already tried to override the commit () method to replace _userPrincipal or attach my own implementation using getSubject (). getPrincipals (). add (new PrincipalImpl ("user")). nor worked as expected.
What error do you get?
Despite this, I think your problem is the third step of this process. SecurityContext only defines BASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH as AuthenticationScheme, so maybe SecurityContext cannot see your implementation of your scheme or type of security. But you can try these steps, and I hope that they will work for you.
A - Implement Java Authentication and Authorization Service (JAAS) LoginModule or extend com.sun.appserv.security.AppservPasswordLoginModule
public class MyLoginModule extends AppservPasswordLoginModule { @Override protected void authenticateUser() throws LoginException { if (!authenticate(_username, _password)) {
B- Introducing the class of your class.
public class MyRealm extends AppservRealm { @Override public void init(Properties props) throws BadRealmException, NoSuchRealmException {
C- Install and configure the area and LoginModule on the server.
To do this, you need to look at JSR 196 and write your own SAM by typing javax.security.auth.message.module.ServerAuthModule. Take a look at the link below. https://blogs.oracle.com/enterprisetechtips/entry/adding_authentication_mechanisms_to_the
source share