diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 8 | ||||
| -rw-r--r-- | src/main.rs | 17 |
2 files changed, 14 insertions, 11 deletions
@@ -55,7 +55,7 @@ pub mod http { pub fn start(&self) { let listener = TcpListener::bind(self.config.bind_addr.clone()).unwrap(); - println!("OAuth2 STS Server listening on {}", self.config.bind_addr); + println!("Listening on {}", self.config.bind_addr); for stream in listener.incoming() { match stream { @@ -168,14 +168,8 @@ pub mod http { "issuer": self.config.issuer_url, "authorization_endpoint": format!("{}/authorize", self.config.issuer_url), "token_endpoint": format!("{}/token", self.config.issuer_url), - "jwks_uri": format!("{}/jwks", self.config.issuer_url), "scopes_supported": ["openid", "profile", "email"], "response_types_supported": ["code"], - "response_modes_supported": ["query"], - "grant_types_supported": ["authorization_code"], - "subject_types_supported": ["public"], - "id_token_signing_alg_values_supported": ["RS256"], - "token_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post"] }); self.send_json_response(stream, 200, "OK", &metadata.to_string()); } diff --git a/src/main.rs b/src/main.rs index 64f8fa3..47bd1ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,13 +28,16 @@ mod tests { let oauth_server = sts::OAuthServer::new(&config); let mut params = HashMap::new(); params.insert("client_id".to_string(), "test_client".to_string()); - params.insert("redirect_uri".to_string(), "http://localhost:3000/callback".to_string()); + params.insert( + "redirect_uri".to_string(), + "http://localhost:3000/callback".to_string(), + ); params.insert("response_type".to_string(), "code".to_string()); params.insert("state".to_string(), "test_state".to_string()); let result = oauth_server.handle_authorize(¶ms); assert!(result.is_ok()); - + let redirect_url = result.unwrap(); assert!(redirect_url.contains("code=")); assert!(redirect_url.contains("state=test_state")); @@ -45,7 +48,10 @@ mod tests { let config = sts::Config::from_env(); let oauth_server = sts::OAuthServer::new(&config); let mut params = HashMap::new(); - params.insert("redirect_uri".to_string(), "http://localhost:3000/callback".to_string()); + params.insert( + "redirect_uri".to_string(), + "http://localhost:3000/callback".to_string(), + ); params.insert("response_type".to_string(), "code".to_string()); let result = oauth_server.handle_authorize(¶ms); @@ -59,7 +65,10 @@ mod tests { let oauth_server = sts::OAuthServer::new(&config); let mut params = HashMap::new(); params.insert("client_id".to_string(), "test_client".to_string()); - params.insert("redirect_uri".to_string(), "http://localhost:3000/callback".to_string()); + params.insert( + "redirect_uri".to_string(), + "http://localhost:3000/callback".to_string(), + ); params.insert("response_type".to_string(), "token".to_string()); let result = oauth_server.handle_authorize(¶ms); |
