foulkon icon indicating copy to clipboard operation
foulkon copied to clipboard

Unable to call /about like in example

Open JonathanSudibya opened this issue 7 years ago • 2 comments

Expected Behavior

Received:

{
  "logger": {
    "type": "default",
    "level": "info"
  },
  "database": {
    "type": "postgres",
    "idleconns": 5,
    "maxopenconns": 20,
    "connttl": 300
  },
  "authenticator": {
    "type": "oidc",
    "oidcProviders": [
      {
        "id": "cedd8d9b-ef69-4eda-a7d1-44548fa34107",
        "name": "google",
        "path": "/gapps/",
        "urn": "urn:iws:auth::oidc/gapps/google",
        "createAt": "2017-05-30T10:51:32.935174579Z",
        "updateAt": "2017-05-30T10:51:32.935174628Z",
        "issuerURL": "https://accounts.google.com",
        "oidcClients": [
          {
            "name": "test-api-client"
          },
          {
            "name": "test-api-client2"
          }
        ]
      },
      {
        "id": "fe2863bf-a90f-4b54-a42c-e65fd1719774",
        "name": "salesforce",
        "path": "/salesforce/",
        "urn": "urn:iws:auth::oidc/salesforce/salesforce",
        "createAt": "2017-05-30T10:51:35.747331949Z",
        "updateAt": "2017-05-30T10:51:35.747331978Z",
        "issuerURL": "https://login.salesforce.com",
        "oidcClients": [
          {
            "name": "test-client"
          }
        ]
      }
    ]
  },
  "version": "v0.5.0-SNAPSHOT"
}

Actual Behavior

Received : {"code":"UnauthorizedResourcesError","message":"Unauthorized, user is not admin"}

Steps to reproduce

  1. Create a simple worker.toml like in example
  2. Run worker using docker
  3. Call curl -n -X GET 192.168.99.100:8000/about -H "Content-Type: application/json" -H "Authorization: Basic admin:admin"

Program Spec

Program version : docker tecsisa/foulkon:latest OS : Windows 10 x64

JonathanSudibya avatar Feb 12 '18 02:02 JonathanSudibya

Hi, You have to encode the string (admin:admin) with base-64 encoding:

"Authorization: Basic YWRtaW46YWRtaW4="

gerson24 avatar Feb 12 '18 07:02 gerson24

Great, the soultion works well @gerson24.

Thanks a lot.

Could you update the doc? 🚀

JonathanSudibya avatar Feb 13 '18 03:02 JonathanSudibya