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

User scopes do not get propagated to the returned JWT provided by EG #740

Open
XVincentX opened this issue May 28, 2018 · 10 comments
Open
Assignees

Comments

@XVincentX
Copy link
Member

XVincentX commented May 28, 2018

The scopes assigned to an user credential (basic-auth, for example) do not get propagated back to the issued JWT for the user.

Somehow related to #608

@XVincentX XVincentX added the bug label May 28, 2018
@XVincentX XVincentX self-assigned this May 28, 2018
@cesarsosa
Copy link

Hey Vincent, do you have an estimate of when this going to be resolved?

@XVincentX
Copy link
Member Author

We'll try to work on it during our next sprint — although unfortunately I had to abandon the current for personal problems. This might require some time to get it done though.

In case it's really a killer feature — we have paid support that would definitely prioritize this.

@XVincentX
Copy link
Member Author

Needs #758

@naprime
Copy link

naprime commented Aug 18, 2018

I assigned scope to JWT credential but EG did NOT check it (alway skip scope check)

========In gateway.config ========
apiEndpoints:

ip:
host: '*'
paths: ['/ip']
scopes: ['admin2']

...

ip:
apiEndpoints:
- ip

policies:
  - jwt:
    - action:
        checkCredentialExistence: false
        secretOrPublicKey: ${JWT_SECRET_KEY:-'whatTheFotFat'}

  - proxy:
    - action:
        serviceEndpoint: httpbin 
        changeOrigin: true

======== Credential info ========
{
"isActive": true,
"createdAt": "Sat Aug 18 2018 03:13:23 GMT+0000 (Coordinated Universal Time)",
"updatedAt": "Sat Aug 18 2018 08:46:18 GMT+0000 (Coordinated Universal Time)",
"keyId": "3kdu0OxwvtPv6CsUDO3L6b",
"keySecret": "41teE9Wu2LuQDoQ6qVbpdO",
"scopes": [
"admin"
],
"consumerId": "eec49fb4-8535-4733-912c-77fcaf22c949",
"type": "jwt",
"id": "3kdu0OxwvtPv6CsUDO3L6b"
}

========scope from apiEndpoint is deference to scope assigned to user but still success ========

$ curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIza2R1ME94d3Z0UHY2Q3NVRE8zTDZiIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.rrF6QdaC10ya98ppwuykbO5xxyLbVcznvi2en8-STwM" http://172.17.0.1:30001/ip
{
"origin": "113.186.178.99"
}

@naprime
Copy link

naprime commented Aug 19, 2018

I fixed by add jwtScopes policy

@nirradi
Copy link

nirradi commented Oct 25, 2018

I'm looking for a place to comment on this for a while, I hope this is relevant:

The sub claim inside the jwt returned from an auth server should be the unique user id of the authenticated user.

From what I saw, eg is returning a hardcoded sub for all requests.

was this intended?

@XVincentX
Copy link
Member Author

@nirradi I need you to elaborate a little bit more. Can you make an example?

@nirradi
Copy link

nirradi commented Oct 25, 2018 via email

@tabishz
Copy link

tabishz commented Nov 12, 2019

I fixed by add jwtScopes policy

could you share a bit more on how to install the jwtScopes plugin and enable it.

@Cinzya
Copy link

Cinzya commented Dec 28, 2021

Any information when / if this is going to be fixed? Is this repo still being worked on? @XVincentX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants