https://supertokens.com/ logo
Verify in .net
w

WillB

05/12/2023, 2:26 PM
Are there any standard approaches to verifying the user in .NET?
r

rp

05/12/2023, 2:29 PM
Hey @WillB you can use any JWT lib to verify in .NET
w

WillB

05/12/2023, 2:30 PM
Yeah was wondering if anyone had any suggestions of libraries to use. I'm assuming something using the JWKS endpoint is probably best? I've found https://github.com/NetDevPack/Security.JwtExtensions
r

rp

05/12/2023, 2:49 PM
Yup. Jwks enpoint use is the way to go.
w

WillB

05/12/2023, 5:59 PM
@rp Is there any reason why I am getting a 404 on my JWKS endpoint?
Upgrading to latest version, it seems to just hang
r

rp

05/12/2023, 6:23 PM
I’m not sure what api you are querying. Could you give more details please?
w

WillB

05/12/2023, 6:35 PM
@rp It was a super weird issue, couldn't load dashboard or anything in my API. Created a new SuperTokens account and connected to a different core and it works
r

rp

05/12/2023, 6:36 PM
hmm. That's odd
anyway, if the error comes again, please let us know
w

WillB

05/12/2023, 7:27 PM
Got it working and roles loading from the supertokens JWT 🙂
Just one issue, when I make a request to my .NET API from my Vue app I seem to get a 401, when I make a request from Swagger it seems to work.
The sAccessToken cookie doesn't seem to be included when I call from my Vue app
Which is weird, because it is somehow included in Swagger on a different port
r

rp

05/12/2023, 7:37 PM
What’s the api domain for your .net backend and what’s the value of apiDomain set on the frontend?
w

WillB

05/12/2023, 7:39 PM
.NET backend: http://localhost:5179 Vue frontend: http://localhost:3000 ST backend: http://localhost:8080 Frontend appInfo:
appInfo: {
    apiDomain: "http://localhost:8080",
    apiBasePath: "/auth",
    appName: "App",
},
r

rp

05/12/2023, 7:46 PM
You might want to get the access token on the frontend and then add that as an authorisation bearer token to the request to your .NET backend
Cause the interception is only applied to the apiDomain
Network interception*
w

WillB

05/12/2023, 7:48 PM
What seems so weird is how the token exists in Swagger which is on the 5179 port?
If I use a reverse proxy and have both on port 8080, will it then load from the cookie correctly?
r

rp

05/12/2023, 7:48 PM
Yes.
w

WillB

05/12/2023, 7:48 PM
I'll try that, thanks 🙂
Forgot to say, that worked. Thank you!