Creating Token for Login Method

I am writing a login method that will authencticate user and return token for web services. Next time user will send is token and we will validate the token but requirement is that we donot wnat to keep any state of token at server.What does it mean that when we receive token, we should be able to detremine is it a valid token or not.(This implied token can't be forged by any user).
I have written a function using KeyPairGenerator, please have a look and let me know if you see any security issue.
Design is
token generateToken(userid) {
hash = hash(userid) ------------------- ONE
Signature = Encrypt (Private key , hash) --------------- TWO
return hash + " " + Signature
bool isValid(token) {
separate part 1 and part 2 of toekn (delimeter is space)
Signature = Encrypt (Public key , part1)
if signature == part2
token is valid
else token is invalid
Code is
PublicKey privateKey ;
PrivateKey publicKey ;
KeyPairGenerator keyGen;
SecureRandom random ;
KeyPair keypair;
public String generateToken() throws Exception{
keyGen = KeyPairGenerator.getInstance("DSA");
random = SecureRandom.getInstance("SHA1PRNG", "SUN");
keyGen.initialize(512 , random);
keypair = keyGen.genKeyPair();
privateKey = keypair.getPrivate();
publicKey = keypair.getPublic();
String token = userName;
byte[] part1 = getHash(1000, token , generateSalt());
/* Create a Signature object and initialize it with the private key */
Signature dsa = Signature.getInstance("SHA1withDSA", "SUN");
dsa.initSign(privateKey);
/* Update and sign the data */
dsa.update(part1, 0 , part1.length) ;
/* Generate a signature for it */
byte[] realSig = dsa.sign();
String tokenToReturn = byteToBase64(part1) + " " + byteToBase64(realSig) ;
return tokenToReturn;
public void verifyToken(String token) throws Exception{
int space = token.indexOf(" ");
String part1 = token.substring(0 , space);
String part2 = token.substring(space+1);
/* create a Signature object and initialize it with the public key */
Signature sig = Signature.getInstance("SHA1withDSA", "SUN");
sig.initVerify(publicKey);
byte[] bPart1 = base64ToByte(part1);
byte[] bPart2 = base64ToByte(part2);
/* Update and sign the data */
sig.update(bPart1, 0 , bPart1.length) ;
if ( sig.verify(bPart2) )
     System.out.println("signature verifies: " );
else
System.out.println("signature does not verifies: " );
Does this code look right ??? Please let me know if you see any pitfalls or know better way to create token

Hello,
one conceptual problem is the fact that once you generate such a token it is valid forever. One idea would be to incorporate the date/time of generation, so that you have some kind of timeout mechanism if the token is too old. Again, the token mechanism will be susceptible to replay attacks for the token's validity period.
For my part, I would tend to go with some kind of one-time token design. Even if you are constrained not to use a database, you could use an in-memory structure to keep track of the generated tokens, mapping them to the users requested them and removing them on an explicit logout or after an expiration time period. This way you don't depend on a timestamp, which implies that you keep a clock well-synchronized. Just my $.02.
Kind regards,
Anestis

Similar Messages

  • Create versions for valuation methods

    In creating versions for valuation method ,I am getting error"View cluster is already open. Go Back with F3
    Message no. SV851" and "inconsistency between CoCo."

    I got the same error when configuring valuation method under controlling module.

  • User created with FOR LOGIN and login does not exist?

    I hope my question is clear.  For testing I made a group in Active Directory named MyDatabaseReadOnly with one user as a member.  I
    do not have a login in SQL Server by the same name.  I created a database user with the following script.
    USE [MyDatabase]
    GO
    CREATE USER [MyDatabaseExec] FOR LOGIN [MyDomain\MyDatabaseReadOnly]
    GO
    The script created the user MyDatabaseExec in MyDatabase.  I gave the user MyDatabaseExec permission to execute one stored procedure.  I then logged in as the lone member of the MyDatabaseReadOnly group and was able to execute the stored procedure
    in SSMS.
    How does this work since there is no login MyDomain\MyDatabaseReadOnly? I understand (I think) that you can create database users
    without a login but I don't understand how I'm able to run the proc.
    Kevin

    The reason is you can have user in the database without a login in the master database and in such case, the user authentication is done through windows group.
    read this article and you can understand  https://msdn.microsoft.com/en-us/library/ms173463.aspx?f=255&MSPPError=-2147217396
    Users based on Windows principals that connect through Windows group logins
    Hope it Helps!!

  • How to create Token for UDO

    HI ,
    I am writing a  report with selection criteria token.
    I would like  to filter a UDO  by using a token.
    I have trouble to use just parameter@ in the selection formula.
    it doesn't give me "choose from list" from the UDO table
    i am using store procedure.
    any idea ?
    Idan

    Hi Idan,
    You may check this: UDT in the Token Selection Criteria - CR 2008 for SB1
    Thanks,
    Gordon

  • How do I create a new payment method in PeopleSoft 9.1 for Vendor payments via external bank program?

    We have contracted with a major banking institution to utilize their credit card program to transact vendor payments.  Basically, we generate a formatted file from our Pay Cycle.  The file is sent to the bank, who in turn notifies the participating vendors that their payments are available.  The vendors access their accounts and draw down our payment via their merchant credit card terminals/system.  We need to create a Payment Method 'CCD'; to be used by the PeopleSoft to update the vendor payables options, and indicate vouchers paid by this method.  PeopleSoft only delivers a few of the payment methods, but not one for credit card programs. Can anyone provide some direction on this and on how to create a new payment method?  Does PeopleSoft 9.2 have this payment method available? 

    Thanks for the suggestion...I did read up on the count function, but I don't think it will give me what I want. I need a a counter that increments for each payment made to a supplier, not a total of the number of payments made to that supplier.
    Any other suggestions, please?
    Tam.

  • IDOCs not created for Payment method "P" and "B"

    Dear Experts,
    I have executed the Automatic Payment program for three payment methods (P,V and B - Foreign Currency) in one Run ID. Payment run was successful but it has created IDOCs for the documents / Vendors attached with payment method "V" but IDOCs were not created for the payment methods "P" and "B". I have checked the configuration relating to payment methods and those were assigned with Form details and the maximum amount is also defined in the payment methods.
    Can any one suggest me where I had made the mistake / where I need to check the configuration settings.
    Thanks a lot.
    Regards,
    Ramnath.

    Hi Surya,
    Please find below error log created while executing the Payment run for the issue.
    Step 002 started (program SAPFPAYM_SCHEDULE, variant &0000000116195, user ID V-PIZHA)
    Step 003 started (program RFFOEDI1, variant &0000003957078, user ID V-PIZHA)
    Maintain an output device in your user master record
    Job cancelled
    Thanks and Regards,
    Ramnath,
    SAP FIMM Team

  • HT1904 how i can create apple ID. i tried my best but get failed, bec it asking for Payment method again and again

    how i can create apple ID. i tried my best but get failed, bec it asking for Payment method again and again

    If you don't want to give payment details then there are instructions on this page for how to create one (the instructions don't work for existing accounts) : http://support.apple.com/kb/HT2534 i.e. select a free app in the store and click on 'Create Apple ID' when 'buying' it

  • Is there any BAPI or FM or Method to create Version for Initiative

    My requirement is :
    when status of decision point for initiative is set to final i.e 003 then version for initiative should get generated. I am serching for BAPI or FM or Method which could generate Version for initiative .

    Hello Naren,
    You can use function module '/RPM/INIS_VERS_CREATE' to create versions for initiatives.
    Alternatively, you can also use the 'class->method'... 'cl_inm_initiative_o_api=>create_initiatives_version'
    Thanks,
    Gaurav

  • Login method for swing

    Let say i got a simple login swing interface now with JPasswordField. Any ideas on how to write the login method for my interface..like if i got different users..i want them each to redirect to another interface.

    Hi ken305,
    I suppose you have your users stored in a database?!? Connected to each user you should have some kind of user-level variabel that you can check, and from that variable you redirect the user to the proper interface.
    Regards.
    / David

  • How to create a byte[] as parameter for a Method inside the Controller

    Hi Experts,
    I want to create a method getCachedWebResource inside the component controller which has a parameter file which is of type byte[].
    But in Netweaver Developer Studio I am not able to create this parameter with type byte[] .
    When I try creating a parameter of this type (byte[]) . I get only byte from drop down and  below Array type checkbox is disabled.
    Please help me in this regards.
    I am already highly obliged to his forum with lots of useful answers. Hoping the same this time too
    Best Regards,
    Roby..

    Robert-
    There are two ways of achieving this:
    1. Create a private getCachedWebResource() method inside your component controller's others section. i.e. do not create a method on the Methods tab, but instead code the method directly into the controller.
    2. Create a parameter of type java.lang.Byte[ ] instead of byte[ ]. This can be done by clicking on the Browse button next to the Type and then choosing the Java Native Type radio button. In the Java Native Type input field provide java.lang.Byte. Click on Ok and you should see the Array Type option getting enabled. Check it, and in the method you should convert from java.lang.Byte to byte.
    I would stick to option (1)
    Cheers-
    Atul

  • How to make a login method for SAP Netweaver in java

    Hi
    Can anyone help me out to make a login() method that can be used to login to the SAP Netweaver server using a simple java code..........
    Hope a helpfull answers from u all....
    THANKS in ADV.
    Rupesh Khemka

    Hi Everyone
    I have made the login() method but i am facing the problem while making the resource context...Because in Resource Context it takes IUser of package
    com.sapportals.portal.security.usermanagement.IUser but I have got IUser of package com.sap.security.api.IUser ...while type Casting it with below code it is giving ClassCAstException.......
    public class NewSimpleServlet extends HttpServlet {
         protected void doGet(
              HttpServletRequest request,
              HttpServletResponse response)
              throws ServletException, IOException {
              StringBuffer s = new StringBuffer();
              try {String j_user="epuser";
                        String j_password="Abcd1234";
                        request.setAttribute("j_user", j_user);
                        request.setAttribute("j_password", j_password);
                        javax.security.auth.Subject subject;
    Set principals = UMFactory.getLogonAuthenticator().logon(request, response, "uidpwdlogon").getPrincipals();
    i have problem with getting IUser object from set of principals. In javadoc is written: "In order to get an IUser object from this subject, call Subject.getPrincipals() and iterate through the returned Set of principals." so i tried to iterate but i was not able to get that IUser with any casting. Do u know how it should be?
    IUser serviceUser = (IUser)subject.getPrincipals().iterator().next();
    Now in resource Context
    ResourceContext c = new ResourceContext(User);
    Here resource context need IUser type object as parameter...
    I also tried st like this
    loggedUser = UMFactory.getAuthenticator().getLoggedInUser(request, response);
    but loggedUser is not authenticated.
    Can Anyone Help me Out...
    Thanks
    Rupesh Khemka

  • Application requires login pollicy to be reconfigured for login to succeed

    Hi,
    We have recently migrated our J2EE application from IBM WebSphere to SAP NetWeaver. The application has two ear modules- one for web tier and the other one for EJBs. We deploy them as two separate applications on the NetWeaver server. For login, we are using JAAS login module.
    We have been facing some problem in login on NetWeaver. The problme is that when we try to login after initially deploying the two application ear files, the login does not succeed. Over many trials that we did, we observed that login succeeded only when we removed the login policy, re-added it, reconfigured it to include the login module, and then tried to login. To put it point-wise, after application ear files are deployed and started, to login to the application first time, we have to do the following steps-
    1) Remove login policy configuration from Security Provider in Visual Administrator
    2) Add it back
    3) Configure it to include the login module
    4) Open the application page and try login- it succeeds.
    This is needed only for the first time login. Then onwards login succeeds with out any issues.
    We are trying to resolve this first time login issue for quite some time now, but to no avail. On investigating the logs when login fails, we realised that our custom UserContext object returned by the login module class becomes invalid (NULL) as it is returned to LoginContext. Here's the call sequence-
    1) Struts action class LoginAction calls JAAS LoginContext.login()
    2) LoginContext.login() calls login module UpServiceLoginModule.login() and passes it an empty (non-null) object of type Subject
    3) UPServiceLoginModule.login() calls security EJB SecurityMgrBean.authenticate().
    4) An application class- UserContext object is returned to UPServiceLoginModule.
    5) UPServiceLoginModule sets UserContext object it received in an object of type Principal and adds it to the set of principals inside Subject it received from LoginContext
    6) The Subject variable in LoginContext has the same reference as the Subject variable in UPServiceLoginModule. However, on investigating the logs we found that even if the Principal is set in the Subject by UPServiceLoginModule properly, inside Subject in LoginContext, it is null.
    Does any one have any clue as to what could be the problem? Below is a relevant trace from the log file. Any help would be greatly appreciated.
    Thanks
    Neelesh
    Logfile Trace-
    #1.5#001125F032ED006D00007262000014D000042958BCAF465D#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.encoding.DeserializationContext] - <Popped element stack to org.apache.axis.message.SOAPEnvelope:Envelope>
    #1.5#001125F032ED006D00007263000014D000042958BCAF46BE#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.encoding.DeserializationContext] - <Exit: DeserializationContext::endElement()>
    #1.5#001125F032ED006D00007264000014D000042958BCAF4720#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.encoding.DeserializationContext] - <Enter: DeserializationContext::endElement(http://impl.security.service.server.tdemand.com, authenticateResponse)>
    #1.5#001125F032ED006D00007265000014D000042958BCAF4790#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] - <org.apache.axis.i18n.resource::handleGetObject(popHandler00)>
    #1.5#001125F032ED006D00007266000014D000042958BCAF47F5#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.encoding.DeserializationContext] - <Popping handler org.apache.axis.message.RPCHandler@828c52>
    #1.5#001125F032ED006D00007267000014D000042958BCAF4864#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] - <org.apache.axis.i18n.resource::handleGetObject(setProp00)>
    #1.5#001125F032ED006D00007268000014D000042958BCAF48CD#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.message.RPCHandler] - <Setting MessageContext property in RPCHandler.endElement().>
    #1.5#001125F032ED006D00007269000014D000042958BCAF4936#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.utils.NSStack] - <NSPop (32)>
    #1.5#001125F032ED006D0000726A000014D000042958BCAF498E#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.encoding.DeserializationContext] - <Popped element stack to null>
    #1.5#001125F032ED006D0000726B000014D000042958BCAF49ED#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.encoding.DeserializationContext] - <Exit: DeserializationContext::endElement()>
    #1.5#001125F032ED006D0000726C000014D000042958BCAF4A6E#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.client.Call] - <Exit: Call::invoke(RPCElement)>
    #1.5#001125F032ED006D0000726D000014D000042958BCAF4ACE#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.client.Call] - <Exit: Call::invoke(ns, meth, args)>
    #1.5#001125F032ED006D0000726E000014D000042958BCAF4B34#1171361006312#System.out#sap.com/TrueDemandWeb#System.out#J2EE_GUEST#2####71678ce0bb4911db9890001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,312 DEBUG [org.apache.axis.TIME] - <axis.Call.invoke: 1516 {http://impl.security.service.server.tdemand.com}authenticate>
    #1.5#001125F032ED006D0000726F000014D000042958BCB07ADE#1171361006390#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,390 ERROR [com.tdemand.client.framework.action.RequestProcessor] - <java.lang.NullPointerException>
    #1.5#001125F032ED006D00007270000014D000042958BCB08026#1171361006390#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,390 ERROR [com.tdemand.client.framework.action.RequestProcessor] - <com.tdemand.client.security.actions.LoginAction.executeLogic(LoginAction.java:53)
    com.tdemand.client.framework.action.Action.execute(Action.java:67)
    com.tdemand.client.framework.action.Action.execute(Action.java:41)
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    com.tdemand.client.framework.action.RequestProcessor.processActionPerform(RequestProcessor.java:53)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.runServlet(FilterChainImpl.java:117)
    com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:62)
    com.tdemand.client.framework.filters.AuthenticationModeFilter.doFilter(AuthenticationModeFilter.java:47)
    com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:58)
    com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:373)
    com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
    com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
    com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
    com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
    com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
    com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
    com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
    com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    java.security.AccessController.doPrivileged(Native Method)
    com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    >
    #1.5#001125F032ED006D00007271000014D000042958BCB09E49#1171361006390#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,390 DEBUG [org.apache.struts.util.PropertyMessageResources] - <Initializing, config='org.apache.struts.action.LocalStrings', returnNull=true>
    #1.5#001125F032ED006D00007272000014D000042958BCB0A784#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - <getMessage(en_US,exception.log)>
    #1.5#001125F032ED006D00007273000014D000042958BCB0A80B#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - <loadLocale(en_US)>
    #1.5#001125F032ED006D00007274000014D000042958BCB0A896#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Loading resource 'org/apache/struts/action/LocalStrings_en_US.properties'>
    #1.5#001125F032ED006D00007275000014D000042958BCB0AAFC#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Loading resource completed>
    #1.5#001125F032ED006D00007276000014D000042958BCB0AB93#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - <loadLocale(en)>
    #1.5#001125F032ED006D00007277000014D000042958BCB0AC02#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Loading resource 'org/apache/struts/action/LocalStrings_en.properties'>
    #1.5#001125F032ED006D00007278000014D000042958BCB0ADEC#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Loading resource completed>
    #1.5#001125F032ED006D00007279000014D000042958BCB0AE7D#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - <loadLocale()>
    #1.5#001125F032ED006D0000727A000014D000042958BCB0AEEB#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Loading resource 'org/apache/struts/action/LocalStrings.properties'>
    #1.5#001125F032ED006D0000727B000014D000042958BCB0B20A#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Loading resource completed>
    #1.5#001125F032ED006D0000727C000014D000042958BCB0B28F#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Saving message key '.dispatch.handler>
    #1.5#001125F032ED006D0000727D000014D000042958BCB0B2FA#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Saving message key '.dispatch.method>
    #1.5#001125F032ED006D0000727E000014D000042958BCB0B363#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Saving message key '.exception.log>
    #1.5#001125F032ED006D0000727F000014D000042958BCB0B3CB#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Saving message key '.dispatch.error>
    #1.5#001125F032ED006D00007280000014D000042958BCB0B436#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Saving message key '.dispatch.return>
    #1.5#001125F032ED006D00007281000014D000042958BCB0B4B8#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.util.PropertyMessageResources] - < Saving message key '.dispatch.parameter>
    #1.5#001125F032ED006D00007282000014D000042958BCB0B660#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.action.ExceptionHandler] - <ExceptionHandler caught this exception:>
    java.lang.NullPointerException
    at com.tdemand.client.security.actions.LoginAction.executeLogic(LoginAction.java:53)
    at com.tdemand.client.framework.action.Action.execute(Action.java:67)
    at com.tdemand.client.framework.action.Action.execute(Action.java:41)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at com.tdemand.client.framework.action.RequestProcessor.processActionPerform(RequestProcessor.java:53)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.runServlet(FilterChainImpl.java:117)
    at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:62)
    at com.tdemand.client.framework.filters.AuthenticationModeFilter.doFilter(AuthenticationModeFilter.java:47)
    at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:58)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:373)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    #1.5#001125F032ED006D00007283000014D000042958BCB0CB4E#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.tiles.TilesRequestProcessor] - <processForwardConfig(/framework/application/jsp/LoginFailure.jsp, false)>
    #1.5#001125F032ED006D00007284000014D000042958BCB0CBF8#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.tiles.TilesRequestProcessor] - < '/framework/application/jsp/LoginFailure.jsp' - processed as uri>
    #1.5#001125F032ED006D00007285000014D000042958BCB0CC6F#1171361006406#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,406 DEBUG [org.apache.struts.action.RequestProcessor] - <processForwardConfig(ForwardConfig[name=null,path=/framework/application/jsp/LoginFailure.jsp,redirect=false,contextRelative=false,module=null])>
    #1.5#001125F032ED006D00007287000014D000042958BCB19A07#1171361006468#System.out#sap.com/TrueDemandWeb#System.out#tdemand#51####7261f270bb4911db963e001125f032ed#SAPEngine_Application_Thread[impl:3]_38##0#0#Info##Plain###2007-02-13 15:33:26,468 DEBUG [org.apache.struts.util.PropertyMessageResources] - <getMessage(en_US,common.applicationTitle)>

    Hi
    when i was creating the Mapping it gave the below Error
    what must have gone wrong??
    My other Question is, how will the Application know about my user credentials as it has to authenticate the same rather than the Portal. Does it mean that for each and every user accessing my app should be configured in the Portal in this manner? I have 1 lakh users accessing this application. Is there any other alternative??
    Regards
    Glen
    ********************E R R O R **********************
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : pcd:portal_content/administrator/super_admin/super_admin_role/com.sap.portal.user_administration/com.sap.portal.user_mapping/com.sap.portal.userMappingAdmin/com.sap.portal.userMappingAdmin
    Component Name : com.sap.portal.usermanagement.admin.UserMappingAdmin
    User Mapping not fully available..
    Exception id: 08:54_01/08/06_0011_8686450
    See the details for the exception ID in the log file
    ********************E R R O R **********************

  • Steps to generate Token for opendoc url call in XI3.1

    Hi Guys,
    I am quite new to Sdk's and java programming .
    I am trying to get some help in generating token for opendoc url to avoid login while trying to access a report in Infoview.
    From a previous post I got this code:
    <%@ page import="com.crystaldecisions.sdk.framework.*" %>
    <%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
    <%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
    <%
    boolean loginSuccessful = false;
    IEnterpriseSession boEnterpriseSession = null;
    String username = "Administrator";
    String password = "pwd";
    String cmsname  = "CMS";
    String authenticationType = "secEnterprise";
    try {
       //Log in.
       boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
       if (boEnterpriseSession == null) {
          out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
       } else {
          loginSuccessful = true;
    } catch (SDKException sdkEx) {
       out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");
    if (loginSuccessful) {
       ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
       String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
       String infoViewURL = null;
       String tokenParam = null;
       String redirectURL = null;
       infoViewURL = "http://server:8080/InfoViewApp/logon.jsp";
       tokenParam = "ivsLogonToken=" + logonToken;
       redirectURL = infoViewURL + "&" + tokenParam;
       response.sendRedirect(redirectURL);
    %>
    The problem is I don't know where to put this code in the opendoc.jsp file.
    I tried to create a custom OpenDoc.jsp with a above code, leaving the original opendoc.jsp as it is. And used this custom jsp file in the opendoc url. This is taking me to Infoview login page and I see taht a token is created at the end of the url but it is not passed.
    Can somebody help me to understand where exactly to put this code in the opendoc.jsp and any correction to this code or additional steps to get it working.
    Any help is greatly appreciated!

    The code above is meant to redirect you to InfoView. Change the last bit of code as follows:
    //add any opendocument parameters to the URL here
    openDocURL = "http://server:8080/OpenDocument/opendoc/openDocument.jsp"
    tokenParam = "token=" + logonToken;
    redirectURL = openDocURL + "&" + tokenParam;
    response.sendRedirect(redirectURL);

  • Help on generating token for opendoc url in XI3.1

    Hi Guys,
    I am trying to get some help in generating token for opendoc url to avoid login while trying to access a report in Infoview.
    From a previous post I got this code:
    <%@ page import="com.crystaldecisions.sdk.framework.*" %>
    <%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
    <%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
    <%
    boolean loginSuccessful = false;
    IEnterpriseSession boEnterpriseSession = null;
    String username = "Administrator";
    String password = "pwd";
    String cmsname = "CMS";
    String authenticationType = "secEnterprise";
    try {
    //Log in.
    boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
    if (boEnterpriseSession == null) {
    out.print("Unable to login.");
    } else {
    loginSuccessful = true;
    } catch (SDKException sdkEx) {
    out.print("ERROR ENCOUNTERED
    " + sdkEx + "");
    if (loginSuccessful) {
    ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
    String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
    String infoViewURL = null;
    String tokenParam = null;
    String redirectURL = null;
    infoViewURL = "http://server:8080/InfoViewApp/logon.jsp";
    tokenParam = "ivsLogonToken=" + logonToken;
    redirectURL = infoViewURL + "&" + tokenParam;
    response.sendRedirect(redirectURL);
    %>
    The problem is I don't know where to put this code in the opendoc.jsp file.
    I tried to create a custom OpenDoc.jsp with a above code, leaving the original opendoc.jsp as it is. And used this custom jsp file in the opendoc url. This is taking me to Infoview login page and I see taht a token is created at the end of the url but it is not passed.
    Can somebody help me to understand where exactly to put this code in the opendoc.jsp and any correction to this code or additional steps to get it working.
    Any help is greatly appreciated

    Stratos,
      Thanks for your inputs,
      I changed the code as you suggested , now my whole code looks like :
    <%@ page import="com.crystaldecisions.sdk.framework.*" %>
    <%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
    <%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
    <%
    boolean loginSuccessful = false;
    IEnterpriseSession boEnterpriseSession = null;
    String username = "user";
    String password = "Password";
    String cmsname  = "Server";
    String authenticationType = "secEnterprise";
    try {
       //Log in.
       boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
       if (boEnterpriseSession == null) {
          out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
       } else {
          loginSuccessful = true;
    } catch (SDKException sdkEx) {
       out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");
    if (loginSuccessful) {
       ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
         String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
         //String logonToken = boLogonTokenMgr.getDefaultToken();
       String infoViewURL = null;
       String tokenParam = null;
       String redirectURL = null;
       infoViewURL = "http://Server:8080/InfoViewApp/logon.jsp";
       tokenParam = "ivsLogonToken=" + logonToken;
       redirectURL = infoViewURL + "&" + tokenParam;
       pageContext.forward( "openDocument.jsp?iDocID=" + 4668 + "&token=" + tokenParam);
    %>
    But I am still getting the Infoview Login Page . The url on the login page is
    http://server:8080/OpenDocument/opendoc/logonTrustedAuth.do?appKind=InfoView&iDocID=4668&isApplication=true&token=ivsLogonToken%server%3A6400%4021181JIipxt70VM0kd90v21179JFd4dHn7kW2FKSBi
    We can see that a token is being generated and appended to this url but it is not passing the user name and password.
    Please let me know what you think about this.

  • Modify unbounded task flow for login process

    I wonder if I can use the unbounded task flow for login process. I have a login page, a home page and a change password page. As per the requirements, I need to show the login page first, if user password is expired, I need to show change password page, after user save the new password, I show the home page. If user password is not expired, then we go to home page directly.
    I have modified the unbound task flow adfc-config.xml. I have created a method call, which references a method in my managed bean to check the redirect page. I have created a router, which would go to change password page or the home page based on different outcomes. But the problem is, every time when I run the application, it always goes to the home page directly, even when the user password is already expired. I have set up break point at the checking redirect page method in my managed bean, looks like it never got called.
    Did I miss any steps here? Please advise. Thanks.

    A method is not a runnable object in your pageflow - so you can't start from it.
    You need to start from a page when your run your project.
    One option - convert your flow to be a bounded flow with the method as a default URL and then run it.
    See - https://blogs.oracle.com/shay/entry/passing_parameters_to_adf_appl

Maybe you are looking for