• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Serve web pages to general public

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Serve web pages to general public

    We are building a public web site using REACT and wish to use Valence Connect to send and receive data from the browser. The users are not Valence users so there is no login.

    Is there a way we can accept "guest" user and allow them what we autorize in the Valence portal, a little bit like DEV Tokens?

    If not, then maybe DEV Tokens is a reasonable solution. Not sure if they can be identified by session. Ideally, a session may time out if the user waits too long.

    Peter

  • #2
    Hi Peter,

    If you're outside the portal then you need to roll your own connection and there is no reason to use valence-connect for communication from the browser to Valence. Make sure the page is pulling in resources/valence.js, calls vvlogin.pgm to create a new session id and it saves that session id to localstorage "localStorage.setItem('sid', response.sid);"

    Would suggest creating a user on the IBM i for this purpose and pass those credentials user/password to vvlogin. Those params must be a UTF-16 encoded and that can be done via the encodeUTF16 method via valence.js

    Example HTTP with a user of "GUEST" and password of "MYGUEST123" to create a new session:
    Code:
    GET /valence/vvlogin.pgm?lng=en&action=login&user=00470055004500530054&password=004D005900470055004500530054003100320033
    Then make your calls to /valence/vvcall.pgm as needed

    Comment


    • #3
      Great,

      Thanks Johnny, we'll try that.

      Peter

      Comment

      Working...
      X