summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/main.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index b60f699..f751c4d 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -29,7 +29,25 @@ async fn main() -> Result<(), anyhow::Error> {
IssuerUrl::new("https://auth.orbekk.com/realms/test".to_string())?,
async_http_client,
).await?;
- log::debug!("{:?}", provider_metadata);
+
+ let client =
+ CoreClient::from_provider_metadata(
+ provider_metadata,
+ ClientId::new("test-client".to_string()),
+ Some(ClientSecret::new("EbIMIpGnYPrG1GBl6eZtVM5zIhiuu5p1".to_string())),
+ )
+ // Set the URL the user will be redirected to after the authorization process.
+ .set_redirect_uri(RedirectUrl::new("https://bridge.orbekk.com/keycloak-callback".to_string())?);
+
+ let (auth_url, csrf_token, nonce) = client
+ .authorize_url(AuthenticationFlow::<CoreResponseType>::AuthorizationCode,
+ CsrfToken::new_random,
+ Nonce::new_random)
+ .add_scope(Scope::new("profile".to_string()))
+ .url();
+
+ log::info!("{:?}", auth_url);
+
rocket::build().mount("/", routes![index]).launch().await;
Ok(())
}