on 05-19-2006 10:14 AM
Hi Everyone,
I have several doubts on creating a custom login module.
1. If I wanted to extend my login module from SAP's HeaderVariableLoginModule class, what is the base class I should extend from? Where can I get the package that contains this base class?
2. The HeaderVariableLoginModule is using the REMOTE_USER header variable. Is there a way to use some other headers instead of using REMOTE_USER? I have tried to configure an option called header="myHeader" in the login stack, but the login module keeps reverting to the REMOTE_USER header variable.
3. In my custom login module, I wanted to get the user's login ID from the header. I used the following lines in my code:
((HttpGetterCallback) callbacks[0]).setType(
HttpCallback.HEADER);
((HttpGetterCallback) callbacks[0]).setName("REMOTE_USER");
If my understanding is correct, this should get the user's login ID from the "REMOTE_USER" header. However, the code is not getting any values from the header. I am pretty positive that the header has been injected into the request because SAP's HeaderVariableLoginModule is working with my "REMOTE_USER" header injection.
Any assistance is greatly appreciated. Should there be any need for clarifications, I would be more than happy to provide them.
Thank You.
Voon,
You can check the following links;
(on slide 63 you have references)
http://help.sap.com/saphelp_nw04s/helpdata/en/68/5ddc40132a8531e10000000a1550b0/content.htm
James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<i>3. In my custom login module, I wanted to get the user's login ID from the header. I used the following lines in my code:
((HttpGetterCallback) callbacks[0]).setType(
HttpCallback.HEADER);
((HttpGetterCallback) callbacks[0]).setName("REMOTE_USER");
If my understanding is correct, this should get the user's login ID from the "REMOTE_USER" header. However, the code is not getting any values from the header. I am pretty positive that the header has been injected into the request because SAP's HeaderVariableLoginModule is working with my "REMOTE_USER" header injection.</i>
To obtain values from a callback handler:
<i>Callback[] callbacks = new Callback[2];
callbacks[0] = new HttpGetterCallback();
callbacks[1] = new HttpGetterCallback();
String headerName = (String)this.options.get("header");
String trustedIPs = (String)this.options.get("trusted_IPs");
if (headerName == null)
headerName = "myHeader";
if (trustedIPs == null)
trustedIPs = "";
((HttpGetterCallback) callbacks[0]).setType(
HttpCallback.HEADER);
((HttpGetterCallback) callbacks[0]).setName(headerName);
((HttpGetterCallback) callbacks[1]).setType(
HttpCallback.CLIENT_IP);
try {
callbackHandler.handle(callbacks);
} catch (UnsupportedCallbackException e) {
return false;
} catch (IOException e) {
throwUserLoginException(e, LoginExceptionDetails.IO_EXCEPTION);
}
userName = (String) ((HttpGetterCallback) callbacks[0]).getValue();
String IP = (String) ((HttpGetterCallback) callbacks[1]).getValue();
loc.infoT("userName: " + userName);
loc.infoT("IP: " + IP);</i>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<i>2. The HeaderVariableLoginModule is using the REMOTE_USER header variable. Is there a way to use some other headers instead of using REMOTE_USER? I have tried to configure an option called header="myHeader" in the login stack, but the login module keeps reverting to the REMOTE_USER header variable.</i>
To use a header other than the default "REMOTE_USER" header for the HeaderVariableLoginModule, specify "Header=<header name to be used>" in the options. The options are case-sensitive and it is therefore imperative to use only "<b>H</b>eader"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Voon,
You can also look into security header authentication;
James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.