Omnis-OAuth2
malkishtini
malkishtini at gmail.com
Thu Aug 20 15:33:31 EDT 2020
Thinking more about the error I'm getting, it could be because my endpoint "'http://localhost:',$root.$prefs.$serverport,'/api/oauth2/',$clib.$remotetasks.rtAuthEndpoints.$restfulapiname,'/code')" is not accessible externally from the auth service.
But if this is the case, then how these demos' libs are supposed to work? I think I'm missing something.
Best regards,
Mayada
-----Original Message-----
From: malkishtini [mailto:malkishtini at gmail.com]
Sent: Thursday, August 20, 2020 3:12 PM
To: 'OmnisDev List - English'
Subject: Omnis-OAuth2
Hello all,
I'm trying to add support to OAuth2 to our Omnis rest API, so I started by downloading and studying the libs from https://github.com/OmnisStudio/Omnis-OAuth2.
When I test them, by passing the hardcoded client and client secret and the same URLs provided in the demo lib I get this error:
{"error_description":"redirect_uri is invalid","state":"480484dd81834a47b20cc62c3b448212","error":"invalid_request"}
I used the default redirect_uri that is provided in the sample lib, which is constructed like below (I used the right port# provided in the readme)
Calculate lRedirectURI as con('http://localhost:',$root.$prefs.$serverport,'/api/oauth2/',$clib.$remotetasks.rtAuthEndpoints.$restfulapiname,'/code')
I was able to reach this endpoint using postman on my local PC and Omnis dev, so I'm not sure what's wrong with my setup that is causing this error.
I wonder if anyone has run this demo lib before and was able to get the token back using the hard coded values in the lib?
Thank you and best regards,
Mayada
More information about the omnisdev-en
mailing list