Salesforce

Accessing EJB-Request Credentials (Magic xpa 2.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Accessing EJB-Request Credentials (Magic xpa 2.x)

EJB-request credentials of the user or application, invoking the EJB method, are passed to the Magic xpa enterprise server by sending the Java object, java.security.Principal class. You may decide not to pass this information by setting the EJB DD PropagatePrincipal environment entry to false, before deploying the EJB.

To access the credential information, you should define a BLOB virtual variable for storing the Java reference to the object and update the variable with the following expression: GetParam('EJB_PRINCIPAL').

If the principal information is stored in a serializable object, like java.security.Principal, the Java reference is a reference to a Java String object and its value is the user name.

If the principal information is not stored in a serializable object, the Java reference is to a Java object from a class that implements java.security.Principal, such as :javax.security.auth.kerberos.KerberosPrincipal or javax.security.auth.x500.X500Principal.

To access the Principal name, you can use the JCall function with the getName method. For example, you can update the <alpha variable> with JCall(<Java ref var>,'getName','()Ljava/lang/String;')

You can use the JInstanceOf function to check if the Java reference relates to a specific class. For example: JInstanceOf(<Java ref var>,' javax.security.auth.kerberos.KerberosPrincipal')

Reference
Attachment 
Attachment