oauth token for sinatra oauth2-provider - sinatra

I am new to Sinatra and want to get it working with oauth2-provider gem. I followed instruction https://github.com/songkick/oauth2-provider#readme and looked at example. But after i've got access_token, i can't get information from Oauth endpoint using this. It generate 401 not Unauthorized error. From my application i do request
http://localhost:9292/me?access_token=, i've tried html request as well as json request, but without success.
Anybody faced with this problem ?

Looks like you did your request using HTTP vs HTTPS. Did you try setting Songkick::OAuth2::Provider.enforce_ssl = false for now?

Related

Why is there no documentation for Next-Auth get authorization url error?

I get this error when trying to signin using next-auth:
[next-auth][error][get_authorization_url_error]
https://next-auth.js.org/errors#get_authorization_url_error {
statusCode: 503...
There documentation says very little about the error https://next-auth.js.org/errors#get_authorization_url_error. Has anyone gotten this error before, or if not, can you direct me to a link that has more information?
You seem to be getting a 503 when requesting the authorization URL from your oauth provider. This generally means some provider settings (either from you or from next-auth) are incorrect. A 503 almost makes me think the URL you're trying to hit to generate the authenticationUrl might have a typo or something.
Can you provide some more details about your setup? [...nextauth].js file, versions of next-auth and next.js, etc.?

Twitter API returns Error 401 (using OAuthSwift)

I'm trying to access Twitter API and getting Error 401. Any idea what I'm doing wrong here? OAuth URL Callback is successful and I get aouth_token and oauth_secret as well. But when I try to access the API, I'm getting 401 in Postman. Thank you in advance.
1. consumer_key
2. consumer_secret
3. oauth_token
4. oauth_token_secret
Attaching postman screenshot.
Twitter API 401 Error in Postman
I believe you are missing some of the required codes. Do you have access_token and
access_token_secret? I have 4 access codes in total, it looks to me like you only got 2.
Error 400 means that the request was invalid or cannot be otherwise served. Requests without authentication are considered invalid and will yield this response. Is there an accompanying error message explaining the error?
Check your app settings to see if you have those other codes! Hope this helps!

Error 401 Authentication failed. Browser based integrations - to login append '?login-form-required=y' to the url you tried to access

In PostMan I'm trying to authenticate with RestAPIs provided in HPALM Guide (API Reference)
At first for authentication if I run this api "almserver/qcbin/authentication-point/alm-authenticate"
it gives
200 OK
but when I check the authenticated api "almserver/qcbin/rest/is-authenticated"
it gives
401 Authentication failed. Browser based integrations - to login
append '?login-form-required=y' to the url you tried to access.
and if I append this '?login-form-required=y' particular line in the end of the second api I will get html page as response
HP Application Lifecycle Management 12.53
background-color: #eee
whereas we expect this
Could some one please help me with this one?
#Sergi #Macintosh_89 I met the same issue with Manu, i post http://almserver***/qcbin/authentication-point/alm-authenticate, but only LWSSO_COOKIE_KEY return back without QCSession, do u knew why?
Your request to almserver/qcbin/authentication-point/alm-authenticate will return a LWSSO_COOKIE_KEY cookie.
You need to add this cookie to the request to almserver/qcbin/rest/is-authenticated.

Magento REST API keeps returning "signature_invalid" error

I'm trying to use the Firefox Rest client extension to test out my Magento REST API. I followed this guide but I keep getting the "signature_invalid" error when making the final request to receive the access token.
Guide: http://devdocs.magento.com/guides/m1x/api/rest/testing_rest_resources.html
The URL I use for the final request is:
http://mymagento/oauth/token?oauth_callback=http://httpbin.org/get&oauth_token=99e48f7d46d3a2f8fef704865fe2f4e4&oauth_secret=eda948ee46250f335146f6f4c5f7d622&oauth_verifier=1d977f0b96f3ae07fff515c590ec6709
And these are the readers:
OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1",
oauth_callback="http%3A%2F%2Fhttpbin.org%2Fget",
oauth_token="99e48f7d46d3a2f8fef704865fe2f4e4",
oauth_secret="eda948ee46250f335146f6f4c5f7d622",
oauth_verifier="1d977f0b96f3ae07fff515c590ec6709",
oauth_nonce="OmOzMMy2Z60m5sV", oauth_timestamp="1495611445",
oauth_consumer_key="abc77ce5a53e67333af04807dea1356b",
oauth_signature="tE6xzRXZIc4BPQ3Dxc80ddoitLg%3D"
The nonce, timestamp and signature are automaticly refreshed each request.
I'm using Magento CE 1.9.2.2.
I have also tried Postman, but that tool gives me a nonce_used error with every request, even though it's automaticly refreshed... Permissions are correctly set up as explained here: http://inchoo.net/magento/configure-magento-rest-and-oauth-settings/
Everything goes fine using the Rest client extension untill the final request where I want to receive the access token.
I found the solution... The local browser had cached the oauth responses...

docusign 401 connecting from server, works in postman

I am just trying to authenticate from NetSuite to docusign. I have my demo account, and am able to send requests successfully using the legacy authentication from postman.
However, when I try the same code in a server side situation, i get the INVALID_TOKEN_FORMAT error.
I've only built 3 or 4 apis so would really appreciate what I might be missing that's causing this 401 error.
NetSuite code (js syntax):
headers = {
'Accept':'application/json',
'Content-Type':'application/json',
'X-DocuSign-Authentication':{'Username':'abcusername','Password':'password123','IntegratorKey':'xyz123'}
};
res = nlapiRequestURL('https://demo.docusign.net/restapi/v2/login_information', '', headers, 'GET');
Ok solved! The authentication object needed to be in xml. Confused bc of the content type and the documentation shows JSON