We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use actix_web::{get, App, HttpResponse, HttpServer, Responder};
#[cfg(feature = "actix")] use zitadel::actix::introspection::{IntrospectedUser, IntrospectionConfigBuilder};
#[get("/unauthed")] async fn unauthed() -> impl Responder { println!("Hello Unauthorized User!"); HttpResponse::Ok().body("Hello Unauthorized User!") }
#[get("/authed")] async fn authed(user: IntrospectedUser) -> impl Responder { println!("Hello Authorized User!"); format!( "Hello Authorized {:?} with id {}", user.username, user.user_id ) }
#[actix_web::main] async fn main() -> std::io::Result<()> { println!("Starting server."); #[cfg(feature = "actix")] let auth = IntrospectionConfigBuilder::new("https://zitadel-libraries-l8boqa.zitadel.cloud") .with_basic_auth( "194339055499018497@zitadel_rust_test", "Ip56oGzxKL1rJ8JaleUVKL7qUlpZ1tqHQYRSd6JE1mTlTJ3pDkDzoObHdZsOg88B", ) .build() .await .unwrap(); HttpServer::new(move || { App::new() .app_data(auth.clone()) .service(unauthed) .service(authed) }) .bind(("0.0.0.0", 8080))? .run() .await }
.app_data(auth.clone()) | ^^^^^^^^ not found in this scope
The text was updated successfully, but these errors were encountered:
No branches or pull requests
use actix_web::{get, App, HttpResponse, HttpServer, Responder};
#[cfg(feature = "actix")]
use zitadel::actix::introspection::{IntrospectedUser, IntrospectionConfigBuilder};
#[get("/unauthed")]
async fn unauthed() -> impl Responder {
println!("Hello Unauthorized User!");
HttpResponse::Ok().body("Hello Unauthorized User!")
}
#[get("/authed")]
async fn authed(user: IntrospectedUser) -> impl Responder {
println!("Hello Authorized User!");
format!(
"Hello Authorized {:?} with id {}",
user.username, user.user_id
)
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
println!("Starting server.");
#[cfg(feature = "actix")]
let auth = IntrospectionConfigBuilder::new("https://zitadel-libraries-l8boqa.zitadel.cloud")
.with_basic_auth(
"194339055499018497@zitadel_rust_test",
"Ip56oGzxKL1rJ8JaleUVKL7qUlpZ1tqHQYRSd6JE1mTlTJ3pDkDzoObHdZsOg88B",
)
.build()
.await
.unwrap();
HttpServer::new(move || {
App::new()
.app_data(auth.clone())
.service(unauthed)
.service(authed)
})
.bind(("0.0.0.0", 8080))?
.run()
.await
}
.app_data(auth.clone())
| ^^^^^^^^ not found in this scope
The text was updated successfully, but these errors were encountered: