Xero failed to validate signature using omniauth-xero and xeroixer - ruby-on-rails

I'm working on a rails application that is integrating with Xero. I'm using omniauth-xero gem to authenticate my users, and the xeroizer gem to interact with Xero's API. I am storing the token, secret token on a model associated with the user. I'm able to access the xeroizer client and see that the access tokens are matching what I'm storing. But when I try to do a basic get request, I get a 401, signature invalid: Failed to validate signature. I'm confused on what the error could be referring to as I have no way to touch the signature between using each of the gems.

Maybe you set a password while export the pfx file and you missed in your code?

Related

Snowflake AAD OAuth2 (EXTERNAL_OAUTH_JWS_CANT_RETRIEVE_PUBLIC_KEY)

We've configured Snowflake for Oauth2 using AAD when we retrieve a token the audience, scope, ... are correct.
But when validating using SYSTEM$VERIFY_EXTERNAL_OAUTH_TOKEN
we receive the following error (and no information can be found why this is occuring)
Token Validation finished.{"Validation Result":"Failed","Failure
Reason":"EXTERNAL_OAUTH_JWS_CANT_RETRIEVE_PUBLIC_KEY"}
Has anyone had this error before?
Most likely while creating the security integration,value for Public Key was not extracted from the IdP's certificate and instead, the certificate was entered.

Decoding a JWT token from a .cer file in Rails

I've been asked to solve a very specific problem. An outside company will authorize the user, and create a JWT token for that user. They will then send us a .cer file (.der and other file types are likely fine too). I then have to decode the JWT within the file.
Our Rails app's current authorization system uses Devise
I've tried finding ways to do this in the JWT gem. I've tried using the OpenSSL library to somehow read the file and turn it into an object that JWT.decode will read.
Let me know if more info is needed

Always getting "code_already_used" when exchanging code for access token w/Slack API

I'm writing a Slack app that adds Slash commands.
Every time I go through the OAuth flow, when I try to exchange a temporary auth code for an access token, I get the following JSON response:
{"ok"=>false, "error"=>"code_already_used"}
and despite that error message, the two slash commands provided by my app do get installed on the target Slack team.
The desired outcome is: I get a successful response from Slack's API, which contains the access_token and scopes for which the token is valid.
Troubleshooting I've tried so far:
Revoked permissions from my app & uninstalling from target team before trying again
Requesting additional scopes (e.g, commands,channels:history,users.profile:read which I don't need, instead of just commands) to see if that would cause the API to return an access token.
I am able to install on other teams outside of the original team I used when creating the app, but with the same api failure
Any suggestions for how to get the API to return an access token? Thanks in advance!

Invalid signature for signature method HMAC-SHA1

I am using oauth 1.0 provider implementation to protect my api as security mechanism.
I am using Oauth Test Client to request token, authorize and get access token and it is working quite fine. But I can not access my protected resources using it as it does not provide such facility.
So i tried to use Netflix Client to generate calls for oauth provider. But when I try to run such calls they are not succeeded but give me HTTP Status 401 - Invalid signature for signature method HMAC-SHA1. I tried to generate signature manually and using some Automatic Method but all ended in same error.
Please can you tell me what I am doing wrong? or could you please refer me to some good material or suggest any solution? Any help will be deeply appreciated.

IMAP OAuth token expiry

Following http://code.google.com/apis/gmail/oauth/protocol.html#imap I'm trying to implement an IMAP client for Gmail that uses OAuth.
My code works fine and I can connect to the IMAP server, however, after 1 day when I retry using the same XOAUTH value, I get an invalid credentials.
It might be a problem in my code causing this, but I need to know if I can pass the same XOAUTH value to the IMAP AUTHENTICATE method everytime or do I need to regenerate it just before trying to access?
My understanding was that once I have the Access Token and Token Secrets back I can use them to generate the XOAUTH value once and then keep using it.
Using the reliable method of trial and error I figured although access token and secret are long living but the XOAUTH value has to be generated for IMAP every time.

Resources