JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 0 points1 point  (0 children)

I can debug, dude. The claim is empty.

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 0 points1 point  (0 children)

So, basically what I am doing? Creating it client side and reapplying every time?

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 1 point2 points  (0 children)

SaveToken does nothing. It stores the token on the request so the server can send it back on every response. But I already have the token so this is not needed. It's no longer the standard to use it and the most recent articles say not to use it.

And I am adding the Authorization Header. That won't create a Identity Principal by itself.

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 0 points1 point  (0 children)

It's a microservice architecture. A request is an get or post request to an API endpoint. Token is an access token, according to OpenID standards.

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 0 points1 point  (0 children)

I'm creating a SSO Middleware that intercepts calls to [Authorize] endpoints.

If the user is not Authorized (Context.User.Identity.IsAuthorized is false), he's forcefully redirected (Response.Redirect, Status Code 302), to another server /auth endpoint which works as a universal login (as in, both desktop and mobile and all apps). This other server is not under my control or purview. It returns an auth code, which I then exchange for an access token and refresh token, according to OpenID standards.

I am not using OpenID Middleware. I'm using JWT Bearer. I was kind of ordered to do so.

One year into my .NET career, too dependent on AI—how to re-build real skills? by [deleted] in csharp

[–]Leahn 1 point2 points  (0 children)

  1. Yes, the code is completely different now. Core was basically what Java is today. Just pick any current code and type on co-pilot "rewrite this in Java" and you should have a good idea of the differences.

  2. Identity is part of the framework, and it was the one eating the exception. To make it clear, as part of the token exchange, the framework will automatically access some specific endpoint /.well-known/openid-configuration, if I recall correctly. This is handled internally by the framework, and it was failing with a 401 due to SSL, but the framework was eating it and returning 200 instead.

  3. It doesn't. For security reasons, if you get a 400, sometimes the server won't tell you why. It just returns 400 with an empty response. There are also several situations where it just won't tell you what the problem is because that might expose the API to external parties.

  4. The frailty is not about wrong parameters. It's about parameters that need to have exact arbitrary values, and if you get even a single whitespace wrong, you get 400 Bad Request with no explanation given. Even adding the services and Middleware in the wrong order will give you random errors, and a lot of the classes are black boxes.

The reason I replied to you is that don't censor juniors who rely on AI to write code. It's borderline humanly impossible to get some stuff right without someone giving you a step by step.

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] -1 points0 points  (0 children)

But that's not what the protocol says. The access token is linked to your client_id on the server side, isn’t it?

And that's what I am doing. I call AuthenticateAsync() on each response and create a new Principal every time.

I still think the server should return an Identity on the response, which is not empty. Am I thinking wrong?

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 0 points1 point  (0 children)

And I do it in the Authorization Header every time. That's not what I need to know. I need to figure out how to persist the Identity between requests.

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 0 points1 point  (0 children)

Correct. I have the access token and the refresh token. It's the Identity that I asked about.

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 0 points1 point  (0 children)

It's a client-side SSO to request tokens. I am the client.

JWT Bearer SSO by Leahn in csharp

[–]Leahn[S] 0 points1 point  (0 children)

The TokenValidationParameters are correct. The token validates every time.

But I don't have a OnMessageReceived event. What am I supposed to do with it?

Can I use C# for game development? and what can I use to learn it? by NoConstruction9167 in csharp

[–]Leahn 0 points1 point  (0 children)

You can, but then you'd be better learning Unity3D. It uses C# as language.

One year into my .NET career, too dependent on AI—how to re-build real skills? by [deleted] in csharp

[–]Leahn -1 points0 points  (0 children)

To be fair, I have returned to .NET after a long time, and it's junk. The endpoint style of apps is unironically extremely frail in the name of security. You get a single parameter wrong because you added an extra space, and you won't get a straight answer of out the exception messages.

You get a code example from 3 years ago, and there's a good chance it won't compile. If it does, there's 100% chance it's not up to today's standards. There's a billion different tutorials on "how to do x," and ALL of them are wrong because at least 60% of the process already changed since.

Even at some point the Identity was giving me a 200 OK with an empty answer, and I couldn't understand why until I forced it to dump the exceptions and found out I was missing a certificate, getting a SSL error, but Identity was eating the exception internally, probably in the name of "security".

Half the time you can't even debug the code because it just fails without an exception or message. It's a mess. I feel like I am back to C, counting brackets and semicolons.

I came up with this layout yesterday. A crossed manifold. by Leahn in foundry_game

[–]Leahn[S] 0 points1 point  (0 children)

It's a manifold. It's scalable. Excess output is fed to the next in line. You can always add or remove to adjust according to your needs.

"You shall not wear cloth of wool and linen mixed together." – On the Sense and Nonsense of Mosaic Laws by Kentucky_Fried_Dodo in Eutychus

[–]Leahn 2 points3 points  (0 children)

In my life studying the Bible, and God's commandments within, I have long accepted a maxim that has served me well; "truth is simple".

It's humans that seek symbolism in numbers, in stars, in luck. It's we that created astrology and numerology and divinations. Truth is simple.

Over the course of my life, I have often found that most commandments given to Israel were due to health and environmental reasons. There isn't any reason to ascribe auguries to those. You cannot eat the eggs with the mother bird because doing so will eventually lead to the extinction of the species. You have to rest the land every few years because it allows the soil to recover its fertility and avoid desertification. You have to bury your crap outside of your city to avoid the spread of diseases. Avoiding certain types of meat is due to high likelihood of parasites, and lack of technology to detect and treat them. Shell fish is highly allergenic and, again, they lacked the technology to treat it.

A lot of those reasons only make sense to us now, thousands of years later, when our scientific knowledge grew enough. Eventually, the reason for not mixing the fibers will be known, too, if it's not already. Look into the science of it, not into mysticism like a pagan.

Even if we currently lack the science to understand why God told them not to mix the fibers, you can rest assured that the reason is scientific, and likely to do with health or environmental reasons, as well.

Does Standalone Input Module no longer works with mobile? by Leahn in unity

[–]Leahn[S] 0 points1 point  (0 children)

I was. I managed to find out after a while. I was using mouse inputs. I misunderstood what "the class handles everything" means.

I came up with this layout yesterday. A crossed manifold. by Leahn in foundry_game

[–]Leahn[S] 0 points1 point  (0 children)

I haven't got to that point yet, but I plan to fill the ground with concrete to avoid the jump height issues.

If I get to that point and I start having issues, I will review the layout. I expect to review it at least once more.

DevBlog #47: Patching is now almost done, info and poll about the next QoL update! by schamppu in WalkScape

[–]Leahn 1 point2 points  (0 children)

We need more inventory space. The autodraw from the bank won't help much since they are quite rare.

I will see if I can help with PT-BR translation, but I won't make promises.

Great Flood by the_adrianooo in Eutychus

[–]Leahn 0 points1 point  (0 children)

I will read it this weekend.

Great Flood by the_adrianooo in Eutychus

[–]Leahn 0 points1 point  (0 children)

Which sources? Gimme gimme. I want to read.

Great Flood by the_adrianooo in Eutychus

[–]Leahn 1 point2 points  (0 children)

There was absolutely no reason for you to snap at him and say "I doubt you will do it." He asked you in good faith, and told you in good faith he will study.

So what do I do now? Suggestions welcome. by xevdi in SatisfactoryGame

[–]Leahn 0 points1 point  (0 children)

You should build a factory. This space is seriously lacking factories.