Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid credentials #25

Open
vmendivil opened this issue Nov 3, 2021 · 2 comments
Open

Invalid credentials #25

vmendivil opened this issue Nov 3, 2021 · 2 comments
Labels
question Further information is requested

Comments

@vmendivil
Copy link

Hi,

I cloned the repo and it's running on Docker. I'm trying to run the postman collection but so far I'm getting 403 "Invalid credentials." error message.

I'm following instructions from the GitHub repo and your documentation.

https://docs.decimals.app/docs/sequence/ZG9jOjEyOTQ0MDY-getting-started#try-out-the-api-collections

This is my docker compose:

"secret-key-hash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"}]' # -> 123

dockercompose

I doubled check the secret-key-hash using https://emn178.github.io/online-tools/sha256.html and it gives the same value for 123

I'm trying to hit the following endpoint: http://localhost:8910/v1/transactions?account=Alice

In postman, as far as I understand, public_key is not really that important? I see some requests only use it on the body to seed initial values, so its value shouldn't matter that much, does it? In case it does in the postman variables I'm using "public_key = abc"

About the secret_key variable in postman, I've tried the below values in the "current value" column of the environmental variables, I cleared "initial value" column just to be safe.

I'm encoding using: https://www.utilities-online.info/base64

Basic 123
Basic 123:
Basic MTIz
Basic MTIzOg==
Basic a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3

Variables

Authorization

Request

None of those secret_key values have worked so far, I always get the same error message: "Invalid credentials." with a 401 Unauthorized code. I even tried the solution out-of-the-box and with the secrets and all that as configured in the repo and still facing the same issue.

I'm not sure what I'm doing wrong or what values I'm incorrectly setting up.

P.D. This is a fantastic work based on what I've read in the documentation and is exactly what I'm looking for, hope you can help me with this authorization issue I'm having. Thank you!!!

@bigfatpaulyj
Copy link

bigfatpaulyj commented Apr 28, 2022

I was able to get this working with the docker-compose config supplied in the repo by using :

curl -v http://localhost:8910/v1/transactions \
  -H 'Origin: https://decimals.stoplight.io' \
  -u '123' \
  -d '{
  "from": "pk_test_decimals_docs",
  "to": "Alice",
  "amount": 1000,
  "currency": "usd"
}'

It will then ask for a password, hit 'enter' to leave it blank. The request then goes through ok.

@andriosrobert
Copy link
Contributor

@vmendivil replying here in case someone else faces this problem; sorry I wasn't able to reply on time:

Postman is likely not adding the : after the username when the password is empty or doing something different.

Try adding the header directly instead of using http basic auth function:

Header key: Authorization
Header value: Basic Basic MTIzOg==

@andriosrobert andriosrobert added the question Further information is requested label Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants