(
client_id: &str,
client_secret: &str,
client_url: &str,
server_url: &str,
)
| 46 | } |
| 47 | |
| 48 | pub fn configure_oauth( |
| 49 | client_id: &str, |
| 50 | client_secret: &str, |
| 51 | client_url: &str, |
| 52 | server_url: &str, |
| 53 | ) -> BasicClient { |
| 54 | let client_id = ClientId::new(client_id.to_string()); |
| 55 | let secret = ClientSecret::new(client_secret.to_string()); |
| 56 | let auth_url = AuthUrl::new(format!("{}/ui/oauth2", server_url)).unwrap(); |
| 57 | let token_url = TokenUrl::new(format!("{}/oauth2/token", server_url)).unwrap(); |
| 58 | let intro_url = |
| 59 | IntrospectionUrl::new(format!("{}/oauth2/token/introspect", server_url)).unwrap(); |
| 60 | let redir_url = RedirectUrl::new(format!("{}/oauth/response", client_url)).unwrap(); |
| 61 | |
| 62 | BasicClient::new(client_id, Some(secret), auth_url, Some(token_url)) |
| 63 | .set_redirect_uri(redir_url) |
| 64 | .set_introspection_uri(intro_url) |
| 65 | } |
| 66 | |
| 67 | // Not authenticated - kick of the redir to oauth. |
| 68 | pub(crate) async fn login_view(mut request: tide::Request<Arc<AppState>>) -> tide::Result { |
nothing calls this directly
no outgoing calls
no test coverage detected