-
Notifications
You must be signed in to change notification settings - Fork 4
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
How to get the user claim populated so that standard attributes can be used #20
Comments
We can definitely got some documentation going for the specific use case. I would like to ask two things:
Assuming the authentication actually does work, if you are passing along the access token, there is only going to be the |
I can definitely throw a sample app together to explain what I'm expecting. I'm currently logging in via a react application and then making a request to the back end API. Nothing really interesting in the claims, only There's no error thrown, only getting a unauthorized result when we should be getting authorised. |
As requested, here is a simple example https://github.com/scott-david-walker/authress-example/
There's a fair chance that I'm missing something really simple here but I'm not seeing it. This setup works with Auth0 and Azure B2C so I'm not sure what I'm doing wrong. Any further questions then please shout. |
Thanks for the reproduction that definitely helped narrow the issue down. First I want to start with some context: ContextAuthress uses the more advanced and modern EdDSA signature with ed25519 keys. Think of this as the v3.0 of RSA. Azure B2C, Cognito, and Auth0 use RS259 with RSA keys (hopefully 2048 bit ones or higher, but I haven't looked into it). Since EdDSA signature is based on ECC, it's believed generally to be more secure. ECC is the preferred signature mechanism for OAuth, everyone should be using it. Some sources will suggest it is the same security but with shorter keys and shorter signatures. So in any case, a better pick. However, this a relatively new concept in the last half a decade, and so there are still a lot of technologies out there that are so slow to implement this strategy which is unfortunate. The good news is, it almost all languages we have created a Action PlanWe will take a multistage approach here to fixing C#:
ConclusionSo since this switch has already been made in your account (we have some admin tool automation for just these sorts of cases) a simple retry in theory should work on your side. I.e. just log in again with your react app, and we can deal with additional issues that come up at that time. I personally really like this solution, it feels clean and easy, rather than additional complexity. However, if you would prefer to go down a different path, that's also doable. FWIW we also have our community at Authress Community if there are additional non library implementation issues. |
First of all, Thanks for the extremely elaborate explanation. Unfortunately, I still appear to be having an issue with the simple weather forecast application auth. I've thrown the jwt into "jwt.io" and found that it classes the algorithm used as "EdDSA". Could you confirm the account that you've associated this change to? I think I may have multiple with the same email address but different providers. I've tried all three of the accounts I created and none of them appear to be returning an RSA algorithm. |
Awesome, could you send us an email at our support with the accountIds you plan on using going forward. The account ID is listed on the General Settings page of the Management Portal. It's fine if you want all of them changed, but I don't want to expose account IDs on GitHub. They aren't super sensitive, but we try to avoid unnecessary data exposure if we can help it. For the record the one we changed was attached to a Google account, the Authress accountId strating with acc_b9i... |
That account is the correct account, I plan on removing the others soon. {
"alg": "EdSDA",
"kid": "kid-here",
"type" : "at+jwt"
} I can also send a support email and continue this conversation there if preferable :-) |
Hey, just kicked it, I'm pretty sure it was still in a cache somewhere, I'll have someone investigate that later though. I just tried this using the Management Portal "Test Connection" button, and got the desired result. Would you be able to try verifying again. I'm sorry for all the extra cycles on this :(. |
That did the trick and now it works perfectly!!!!! Thanks!! |
👍 I assume there is going to be a similar dance when it comes to the M2M tokens, depending on whether or not you use the |
My intention would be to provide each consumer of the API a machine to machine credential. So that they can use an OAuth flow rather than an api key. Would the link you provide be the correct approach for this? |
By API, I'm assuming you mean your service's API. Then Yes. Normally, service clients could use the So if it doesn't or it isn't obvious how to do that, we can take that discussion to an email, and we'll get it fixed. |
Hi,
I'm wondering if you have any documentation on the correct way of validating the authentication of a user using the standard .NET way (E.G. via Authorize attributes].
I've tried numerous implementations with the "AddJwtBearer" all with no success.
What I'd expect is to be able to do something like this:
and have this auto populate the identity so that I can use the attributes as normal.
Any advice on this would be welcome.
Cheers
The text was updated successfully, but these errors were encountered: