Skip to main content

Error on connection page

Comments

4 comments

  • Official comment
    Pryv Support

    Hello Medval,

    Thank you for reporting your issue !

    The issue you are facing is related to the Authentication process. The page "access.html" is opened when you authenticate your app following the procedure here : https://api.pryv.com/reference/#authenticate-your-app .

    You can test it on your own platform following the guide here : https://api.pryv.com/getting-started/#obtain-an-access-token and opening the Demo App (https://api.pryv.com/app-web-access/?pryvServiceInfoUrl=https://reg.pryv.me/service/info).

    Please replace the "service info" query parameter by your own server address that should look like "http(s)://yourserver/reg/service/info".

    Let us know if it solves the problem for you !

  • Mehdi Valette

    Thank you Anastasia for your quick response.

    The procedure did solve my issue. Unfortunately a second issue appears. When I try to login it indicates the error "Failed to login".

    In Firefox's console, under Network, there is the following response (401):

    {
    "error": {
    "id": "invalid-credentials",
    "message": "The app id (\"appId\") is either missing or not trusted."
    },
    "meta": {
    "apiVersion": "1.5.18-open",
    "serverTime": 1593776300.692,
    "serial": "t1593776274"
    }
    }

    The request that was made :

    {
    "username": "admin",
    "password": "adminadmin",
    "appId": "pryv-app-web-auth-3"
    }

    I assume I must somehow add "pryv-app-web-auth-3" to the list of trusted app, but I couldn't find how to do that.

    Thank you,

    Mehdi

    0
  • Pryv Support

    Hello Mehdi,

    As described here https://api.pryv.com/reference/#trusted-apps-verification, the trusted app depends on both the appId payload field and the request's Origin (or Referer for Firefox) header, which is set by the browser on the URL of the page where it is hosted.

    If you have exposed your Open Pryv.io platform under a certain HOSTNAME, you should edit your configuration field `trustedApps` (in config.json) to:

    "trustedApps": "*@http://pryv.github.io, *@https://*HOSTNAME*"

    I hope it helps !

    Best,

    Anastasia 

    0
  • Mehdi Valette

    Hello Anastasia,

    I changed "@https://localhost*" to "@http://localhost*" and everything is working now. I could create a master token and interact with the localhost backend using Postman. I assume I can simply change http->https when using TLS in the future.

    Thank you very much for your help

    0

Please sign in to leave a comment.