How to use ClientPrincipal with 'progress.data.Session' - Forum - Rollbase - Progress Community

How to use ClientPrincipal with 'progress.data.Session'

 Forum

How to use ClientPrincipal with 'progress.data.Session'

This question is answered

Hi,

In Rollbase we use objects from OpenEdge service.

We are currently working to change the user authentication to OpenEdge Authentication (through HybridRealm class) and  the objects authentication from 'No Authentication' to 'Use Current User'.

On the objects pages, we also have javascript code that made direct call to OpenEdge services  using 'progress.data.Session' (see below image) .

How can we use ClientPrincipal with 'progress.data.Session' ? Do you know any links that I can check?

Thanks,

Daniela

Verified Answer
  • Hi,

    You can also use serverside API: rbv_api.sendJSONRequest and add CP_TOKEN to the call headers. As in the example below:


    This should be working on both old and new Rollbase UI.

    Best regards,

    Dora

All Replies
  • Client principal is not made available to client side pages directly for obvious security reasons..

    However it is available as a token in Server-Side..

    We have a new ClientSide API for such usecase

    See www.progress.com/.../client-side-rest-invocations-in-rollbase

    To use Client Principal, use this token - #CP_TOKEN

  • Hi,

    Thanks for the link.

    When using rbf_sendHttpRequest, I got the following error: 'Administrator does not allow client-side REST Service calls for this domain:..'; is there something else I need to set or check?

    I can see that this is a solution for new UI, is there a solution for old Rollbase UI?

    Thanks,

    Daniela

  • To resolve error 'Administrator does not allow client-side REST Service calls for this domain:..' please add host first to the Hosts Whitelist for Client REST API

    This option is accessible from application edit settings. Just click on any app -> edit -> scroll down and you should see the option we are talking about.

  • Hi,

    You can also use serverside API: rbv_api.sendJSONRequest and add CP_TOKEN to the call headers. As in the example below:


    This should be working on both old and new Rollbase UI.

    Best regards,

    Dora