Skip to content

Commit 681c884

Browse files
committed
Fix compatibility with Auth0 for OpenID-Connect authentification.
See ramosbugs/openidconnect-rs#23
1 parent 6e90639 commit 681c884

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG.md
22

3+
## 0.40.1
4+
- Fix compatibility with Auth0 for OpenID-Connect authentification. See https://github.com/ramosbugs/openidconnect-rs/issues/23
5+
36
## 0.40.0 (2025-11-28)
47
- OIDC login redirects now use HTTP 303 responses so POST submissions are converted to safe GET requests before reaching the identity provider, fixing incorrect reuse of the original POST (HTTP 307) that could break standard auth flows.
58
- SQLPage now respects [HTTP accept headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept) for JSON. You can now easily process the contents of any existing sql page programmatically with:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ rustls-native-certs = "0.8.1"
7777
awc = { version = "3", features = ["rustls-0_23-webpki-roots"] }
7878
clap = { version = "4.5.17", features = ["derive"] }
7979
tokio-util = "0.7.12"
80-
openidconnect = { version = "4.0.0", default-features = false }
80+
openidconnect = { version = "4.0.0", default-features = false, features = ["accept-rfc3339-timestamps"] }
8181
encoding_rs = "0.8.35"
8282
odbc-sys = { version = "0.27.4", optional = true }
8383

src/webserver/oidc.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,4 +853,19 @@ mod tests {
853853
.expect("invalid location header");
854854
assert_eq!(location, "/foo");
855855
}
856+
857+
#[test]
858+
fn parse_auth0_rfc3339_updated_at() {
859+
let claims_json = r#"{
860+
"sub": "auth0|123456",
861+
"iss": "https://example.auth0.com/",
862+
"aud": "test-client-id",
863+
"iat": 1700000000,
864+
"exp": 1700086400,
865+
"updated_at": "2023-11-14T12:00:00.000Z"
866+
}"#;
867+
let claims: OidcClaims = serde_json::from_str(claims_json)
868+
.expect("Auth0 returns updated_at as RFC3339 string, not unix timestamp");
869+
assert!(claims.updated_at().is_some());
870+
}
856871
}

0 commit comments

Comments
 (0)