-
Notifications
You must be signed in to change notification settings - Fork 24
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
What fields should my JWT define? #201
Comments
It sounds like you might want to implement a custom The token-based auth. service is very simple and can be used as a skeleton for getting started creating a JWT version: https://github.com/stargate/stargate/tree/v1.0.50/auth-table-based-service/src/main/java/io/stargate/auth/table The JWT could contain whatever you need to handle authn/authz. |
I want to avoid customizing the code... The dream was to just use the K8ssandra helm chars or Kustomize. |
@caniko have you taken a look at the JWT docs here? Your JWT should contain a For row level access control you'll want to create another field inside the So, as is, the JWT based auth will perform authn without needing cqlsh but if you want to do full authz then you'll need to modify |
Thank you @dougwettlaufer. I have a few more questions:
Also, I don't think I need custom |
The
You'll pass the URL of the "well-known" endpoint to stargate with |
This makes sense, thank you.
Using JWKS is OK. However, I was hoping to have the option to decrypt the JWT on Stargate by passing the public key from an opaque secret. |
@dougwettlaufer, could you confirm if the example below is correct?
Read scenario Modify scenario {
`x-stargate-COLUMN_NAME`: <correct value>
`x-stargate-role`: `cqlsh role`
} Stargate relays the modification requested by the client to Cassandra. |
@caniko that should be correct. Although you can probably leave off |
Lastly, which of the key-value pairs returned from the JWKS endpoint is used by Stargate? {
"keys": [
{
"kid": "vdaec4Br3ZnRFtZN-pimK9v1eGd3gL2MHu8rQ6M5SiE",
"kty": "RSA",
"alg": "RS256",
"use": "sig",
"n": "4OPCc_LDhU6ADQj7cEgRei4VUf4PZH8GYsxsR6RSdeKmDvZ48hCSEFiEgfc3FIfh-gC4r9PtKucc_nkRofrAKR4qL8KNNoSuzQAOC92Yz6r7Ao4HppHJ8-QVdo5H-d9wfNSlDLBSo5My4b4EnHb1HLuFxDqyhFpGvsoUJdgbt3m_Q3WAVb2yrM83S6HX__vrQvqUk2e7z5RNrI7LSsW3ZOz9fU7pvm8-kFFAIPJ7fOJIC7UQ9wBWg3YdwQ0B2b24jXjVr0QCGzqJ6o1G_UZYSJCDMGQDpDcEuYnvSKBLfVR-0EcAjolRhcSPjHlW0Cp0YU8qwWDHpjkbrMrFmxlO4Q",
"e": "AQAB"
}
]
}
Definitely And, how does Stargate know which |
@caniko - Did you ever get further with this project? Is there anything that you believe should be documented from your experience with JWT? |
@dougwettlaufer additional to my previous question: What if {
`x-stargate-COLUMN_NAME`: <correct value>
`x-stargate-role`: `cqlsh role`
} Is it only read in that case? Or can I provide another role in those cases? As mentioned before: I want global read-only. |
First:
I have an authentication server that generates JWTs, and I would like to use it for authentication in StargateAPI. I couldn't find an explicit outline of fields that the JWT needs to store in the docs. What are these fields?
Second:
I am interested in implementing row-based permission for modification, and I would like to avoid creating roles in CQLSH, and do it purely over JWTs. The logical operation is simple: if the owner ID (table column) is not identical to the user ID (on the JWT) the client has no modication rights, but can still read the row. I believe at least some devs to be interested in this topic, it should be mentioned.
The authentication documentation should focus on defining/outlining more key concepts, including these.
The text was updated successfully, but these errors were encountered: