Created
October 19, 2024 16:39
-
-
Save jrgleason/5a6a4d0e2985253b5a070cc6489d2d92 to your computer and use it in GitHub Desktop.
Revisions
-
jrgleason revised this gist
Oct 19, 2024 . 2 changed files with 36 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.csrf(AbstractHttpConfigurer::disable) .oauth2Login(AbstractHttpConfigurer::disable) .oauth2ResourceServer(AbstractHttpConfigurer::disable) .sessionManagement((session) -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .oauth2ResourceServer((oauth2) -> oauth2 .jwt((jwt) -> jwt.decoder(jwtDecoder())) ) .authorizeHttpRequests((authz) -> authz .requestMatchers( new AntPathRequestMatcher("/actuator/**") ).hasAuthority("SCOPE_read:actuators") .requestMatchers( new AntPathRequestMatcher("/customer/**", "POST") ).hasAuthority("SCOPE_user:admin") .requestMatchers( new AntPathRequestMatcher("/chat"), new AntPathRequestMatcher("/chat/**"), new AntPathRequestMatcher("/app/chat"), new AntPathRequestMatcher("/app/chat/**"), new AntPathRequestMatcher("/topic/**"), new AntPathRequestMatcher("/heartbeat", "GET"), new AntPathRequestMatcher("/contact"), new AntPathRequestMatcher("/contact", "POST"), new AntPathRequestMatcher("/contact/**"), new AntPathRequestMatcher("/assistant", "GET"), new AntPathRequestMatcher("/user/stash") ).permitAll() .requestMatchers( new AntPathRequestMatcher("/finance") ).hasAuthority("SCOPE_finance") .anyRequest().authenticated() ); return http.build(); } -
jrgleason created this gist
Oct 19, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <Auth0Provider // @ts-ignore domain={domain} // @ts-ignore clientId={clientId} useRefreshTokens={true} cacheLocation={"localstorage"} // TODO: Avoid hardcoding these values advancedOptions={{defaultScope: 'email'}} authorizationParams={{ redirect_uri: redirectUrl, audience: "https://cbusha.com", defaultScope: "email", }} > <Router> <CssBaseline/> <CBusAppBar/> <main style={{height: "100%"}}> <Splash/> </main> </Router> </Auth0Provider>