ermites-io / oidc Goto Github PK
View Code? Open in Web Editor NEWa hardened golang OpenID connect library
License: BSD 3-Clause "New" or "Revised" License
a hardened golang OpenID connect library
License: BSD 3-Clause "New" or "Revised" License
as title says, comment for more docs & links will follow
Because of all the tenants and the various hacks of microsoft, OpenID connect needs some tweaks as to match proper issuers, reported by @mestrade on implementing oidc with Azure validation errors ends up with this:
invalid iss: https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0 vs issuer: https://login.microsoftonline.com/{tenantid}/v2.0
also ID tokens claims includes microsoft specific fields : tid
which can be used, check @mestrade PR #2 for details of the problem.
References:
In:
oidc/internal/jwk/jwk_parse.go
Line 79 in be77d2c
The code using "alg" in the jwk parsing is disabled. The alg is determined with the len of the "n" modulus found in the jwk.
Using the modulus len with Google/Microsoft/Github oauth/oidc endpoints is working well.
Gitlab is actually providing "alg" as "RS256" but the provided "n" modulus len is 512, which cause rsa.Verify to fail.
By using the "alg" value, the verification is done correctly.
RSA private key representation
gitlab keys from oidc configuration url
We are using AEAD inside this library, should we implement a key commitment scheme?
keys are pseudo-random (KDF, so I lean toward a KISS: no), the validation endpoint might act as an oracle in a potential key partionning attack against the cookie, let's verify and make sure it does not happen.
Key commitment could just remove that risk.
References:
JWT issuer, audience and expiration verification happens ONLY after JWT sig validation.
IMHO there is no need to engage heavy crypto operations if JWT issuer, audience and expiration are not valid.
WDYT?
as title says.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.