apisix icon indicating copy to clipboard operation
apisix copied to clipboard

request help: oidc problem

Open Marco-Zheng opened this issue 3 years ago • 7 comments

Issue description

I configure oidc as below image here is my introspection_endpoint method image then i send request as below image but it return back 401 Authorization Required

Environment

  • apisix version 2.4

Marco-Zheng avatar Apr 25 '21 09:04 Marco-Zheng

This is caused by an invalid authorization header value. You should check this authorization header. Looking at the test case, Authorization should be "Bearer"+ "access_token".

https://github.com/apache/apisix/blob/8b4a36b0c233e9ceb750f3120bd5f4798ac199b8/t/plugin/openid-connect.t#L1408

Firstsawyou avatar Apr 26 '21 03:04 Firstsawyou

This is caused by an invalid authorization header value. You should check this authorization header. Looking at the test case, Authorization should be "Bearer"+ "access_token".

https://github.com/apache/apisix/blob/8b4a36b0c233e9ceb750f3120bd5f4798ac199b8/t/plugin/openid-connect.t#L1408

I use this one , but also doesn't work. image

Marco-Zheng avatar Apr 26 '21 07:04 Marco-Zheng

This is caused by an invalid authorization header value. You should check this authorization header. Looking at the test case, Authorization should be "Bearer"+ "access_token".

https://github.com/apache/apisix/blob/8b4a36b0c233e9ceb750f3120bd5f4798ac199b8/t/plugin/openid-connect.t#L1408

my service config like this

{
  "name": "dental-pratice-patient-web-dev",
  "desc": "患者dev服务",
  "upstream_id": "102",
  "plugins": {
    "cors": {
      "disable": false
    },
    "jwt-auth": {
      "disable": true
    },
    "limit-conn": {
      "burst": 0,
      "conn": 1,
      "default_conn_delay": 0.1,
      "disable": true,
      "key": "remote_addr",
      "rejected_code": 503
    },
    "limit-req": {
      "burst": 1,
      "disable": true,
      "key": "remote_addr",
      "rate": 3,
      "rejected_code": 503
    },
    "openid-connect": {
      "bearer_only": true,
      "client_id": "apisix",
      "client_secret": "client_secret_code",
      "disable": false,
      "discovery": "http://localhost:8888/oidc/token",
      "introspection_endpoint": "http://localhost:8888/oidc/auth",
      "introspection_endpoint_auth_method": "client_secret_basic",
      "realm": "master"
    },
    "request-id": {
      "disable": false,
      "include_in_response": true
    }
  }
}'

Marco-Zheng avatar Apr 26 '21 07:04 Marco-Zheng

This is caused by an invalid authorization header value. You should check this authorization header. Looking at the test case, Authorization should be "Bearer"+ "access_token".

https://github.com/apache/apisix/blob/8b4a36b0c233e9ceb750f3120bd5f4798ac199b8/t/plugin/openid-connect.t#L1408

I found the problem! localhost:8888 is not allowed.. I would like to suggest that can accept localhost mode.

Marco-Zheng avatar Apr 26 '21 07:04 Marco-Zheng

This is caused by an invalid authorization header value. You should check this authorization header. Looking at the test case, Authorization should be "Bearer"+ "access_token".

https://github.com/apache/apisix/blob/8b4a36b0c233e9ceb750f3120bd5f4798ac199b8/t/plugin/openid-connect.t#L1408

Here comes another problem, i set the redirect_uri, but i didn't receive it while i send a request to gateway image the error mesaage is image

Marco-Zheng avatar Apr 26 '21 08:04 Marco-Zheng

Issue description

I configure oidc as below image here is my introspection_endpoint method image then i send request as below image but it return back 401 Authorization Required

Environment

  • apisix version 2.4

hello does the code of authserver can share with me ?

smlHao avatar Aug 12 '21 11:08 smlHao

This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Jul 29 '22 10:07 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Aug 12 '22 10:08 github-actions[bot]