Skip to content

Commit

Permalink
Fix certificates for proxy communication and optional openid nonce is…
Browse files Browse the repository at this point in the history
…sues (#974)

* fix root certs

* bump version

* remove nonce check on the frontend

* remove nonce
  • Loading branch information
t-aleksander authored Jan 28, 2025
1 parent 185c0ba commit 5cd8992
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "defguard"
version = "1.2.1"
version = "1.2.2"
edition = "2021"
license-file = "LICENSE.md"
homepage = "https://defguard.net/"
Expand Down Expand Up @@ -84,7 +84,7 @@ tokio = { version = "1", features = [
] }
tokio-stream = "0.1"
tokio-util = "0.7"
tonic = { version = "0.12", features = ["gzip", "tls", "tls-roots"] }
tonic = { version = "0.12", features = ["gzip", "tls", "tls-native-roots"] }
tonic-health = "0.12"
totp-lite = { version = "2.0" }
tower-http = { version = "0.6", features = ["fs", "trace"] }
Expand Down
2 changes: 1 addition & 1 deletion src/grpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ pub async fn run_grpc_bidi_stream(
let tls = ClientTlsConfig::new().ca_certificate(Certificate::from_pem(ca));
endpoint.tls_config(tls)?
} else {
endpoint
endpoint.tls_config(ClientTlsConfig::new().with_enabled_roots())?
};

loop {
Expand Down
7 changes: 3 additions & 4 deletions web/src/pages/allow/OpenidAllowPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const OpenidAllowPage = () => {
const [scope, setScope] = useState<string | null>('');
const [responseType, setResponseType] = useState<string | null>('');
const [clientId, setClientId] = useState<string | null>('');
const [nonce, setNonce] = useState<string | null>('');
const [redirectUri, setRedirectUri] = useState<string | null>('');
const [state, setState] = useState<string | null>('');
const [name, setName] = useState<string | null>('');
Expand All @@ -42,15 +41,16 @@ export const OpenidAllowPage = () => {
const { LL } = useI18nContext();

const paramsValid = useMemo(() => {
const check = [scope, responseType, clientId, nonce, redirectUri, state];
// nonce is optional in the auth code flow, just pass it as is further if it's in the params
const check = [scope, responseType, clientId, redirectUri, state];
for (const item of check) {
if (typeof item === 'undefined' || item === null) {
toaster.error('OpenID Params invalid.');
return false;
}
}
return true;
}, [clientId, nonce, redirectUri, responseType, scope, state, toaster]);
}, [clientId, redirectUri, responseType, scope, state, toaster]);

const handleSubmit = useCallback(
(allow: boolean) => {
Expand All @@ -68,7 +68,6 @@ export const OpenidAllowPage = () => {
setScope(params.get('scope'));
setResponseType(params.get('response_type'));
setClientId(params.get('client_id'));
setNonce(params.get('nonce'));
setState(params.get('state'));
setRedirectUri(params.get('redirect_uri'));
}, [params]);
Expand Down

0 comments on commit 5cd8992

Please sign in to comment.