cancel
Showing results for 
Search instead for 
Did you mean: 

EP user credentials as attributes of BSP

Former Member
0 Kudos

Hallo,

I'm developing BSP which will be integrated to EP and which requires some information about current EP user. Concretly - preferably user's department or also last name. Is there way how to put this informations to BSP attributes?

Best regards,

Josef Motl

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Josef,

To add on what Siddhartha has suggested, if you read the SSO2 cookie from the BSP page you also need to decrypt the cookie content and get the user details from that.

Regards,

Ravikiran.

athavanraja
Active Contributor
0 Kudos

does anybody know how to decode the SSO2 cookie?

<u><b>How to pass logged on user of portal to BSP application.</b></u>

In the BSP application start page have a page attribute with auto checked. (for example <b>username</b>)

Now in BSP iview's application parameter type in the following

<b>username=<User.UserId></b>

this will pass the portal logged on user id to BSP application which you can read it in oninitialization and do further processing.

Regards

Raja

Former Member
0 Kudos

HI,

Raja,

Are you sugeesting to HARD code the Application Parameter username in the iView or will it assign the value dynamically for logged in user,just like sy-uname ?

I could'nt get this to work ,so it would be great if you could guide.

Till now i was reading the MYSAPSSO2 cookie to get the logged in EP user.

Regards,

Siddhartha

athavanraja
Active Contributor
0 Kudos

No its not harcoding.

<User.UserId> will pass the EP logged on user.

this (<User.UserId>) will dynamically get the EP logged on user. as far as i know this works from EP6 SP2

can you share the ABAP code you used for reading and parsing the MYSAPSSO2 cookie.

<i><b>I could'nt get this to work</b></i>

What kind of iview you have? this will work for all appintegrator based iviews , like BSP iview, BW query iview, etc

Regards

Raja

Former Member
0 Kudos

Hi,

RAja, i am on EP6 SP9 and using BSP iview.when i use the application parameters as you have mentioned i get a <b>null pointer exception</b>.

For reading the MYSAPSSO2 cookie,i used javascript as it is a browser cookie,so i couldn't read it with ABAP.

After reading the cookie in a string variable via an input field,i submit the form and use the HTTP utility class to decode it (base64) and after splitting the resultant string,i get the user.

If you want i can post the entire code for reference.

Regards,

Siddhartha

Message was edited by: Siddhartha Jain

athavanraja
Active Contributor
0 Kudos

sorry there was a small mistake.

it is case sensitive.

you need to use

<User.UserID>

you can also use

<User.LogonUid>

Regards

Raja

Former Member
0 Kudos

HI,

Great,it works now,Thanks,

guess now we have 2 options of getting the logged in user in EP.

As for reading the MYSAPSSO2 cookie is concerned,

The javascript would be

<script language="JavaScript" type="text/javascript">

 function ReadCookie()
{
 <%if flag is initial.%>
 var cookiename = "MYSAPSSO2";
 var cookiestring=""+document.cookie;
 var index1=cookiestring.indexOf(cookiename);
 if (index1==-1 || cookiename=="") return "";
 var index2=cookiestring.indexOf(';',index1);
 if (index2==-1) index2=cookiestring.length;
 document.formAccnt.ip1.value = unescape(cookiestring.substring(index1+cookiename.length+1,index2));
 document.formAccnt.submit();
 <%endif.%>
}
</SCRIPT>
In Form  layout
<htmlb:inputField id    = "ip1"
                        type  = "STRING"
                        value = "<%= mysapsso2 %>"
                         visible="FALSE"/>
And in onInputProcessing
mysapsso2 = request->get_form_field( 'ip1').
    IF mysapsso2 IS NOT INITIAL.
      DATA: utility TYPE REF TO cl_http_utility.
      CREATE OBJECT utility.

      CALL METHOD utility->decode_base64
        EXPORTING
          encoded = mysapsso2
        RECEIVING
          decoded = cookie.

     CALL METHOD utility->escape_url
        EXPORTING
          unescaped   = cookie
        RECEIVING
          escaped = cookie.

      SPLIT cookie AT 'portal%3a' INTO temp3 username.
     split username at '%88' into username temp3.

    ENDIF.

Regards,

Siddhartha

Message was edited by: Siddhartha Jain

athavanraja
Active Contributor
0 Kudos

Hi Siddartha ,

Thanks for the code sample.

MYSAPSSO2 also can be passed like user id by placing the following in the application parameter

<BSP paramname>=<Request.SSO2Ticket>

Regards

Raja

Former Member
0 Kudos

HI Raja,

Thanks for sharing the "GYAN"

The APP integrator indeed can help in numerous ways like this.

Regards,

Siddhartha

athavanraja
Active Contributor
0 Kudos

You are welcome. But you have to be aware that app integrator based iviews use GET method - url parameters.

Regards

Raja

Former Member
0 Kudos

Hi Raja and Jain,

thank you guys for all of your responses. I recieved from your dialog more then I expected.

I found on this forum most suitable solution for my problem: <User.department>. More about this dynamic parameters can be found at:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/s-u/the application integrator in ep 6.0

Best regards,

Josef

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Kudos

if you are using SSO using logon ticket within your BSP application if you get the sy-uanme it will be same user who logged on to portal.

if you had user mapping for BSP iviews then its like logging on to SAP system with a single user id in which case the sy-uname will not give the right name of the person who logged on to portal. to over come this you can pass portal logged on user as the application parameter for the BSP iview which you can read it in your BSP and process further.

once you have the name your could read usr* table or pa0002 table to get his other details.

Regards

Raja

Message was edited by: Durairaj Athavan Raja

Former Member
0 Kudos

Hi Raja,

Thank you for your responce, but can you give me more detailed description how to pass parameters from iView to BSP? I'm using default user for BSPs (no SSO logon ticket).

Regards,

Josef

Former Member
0 Kudos

HI josef,

If you just want to know the EP logged in user you can read the MYSAPSSO2 cookie which is generated by EP to get the logged in user,the server ,session,timestamp etc.

Regards,

Siddhartha