Skip to content
New issue

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

1822 - Implement basic authentication #10

Closed
Tracked by #1
njtalba5127 opened this issue Dec 8, 2022 · 2 comments · Fixed by #26 or #27
Closed
Tracked by #1

1822 - Implement basic authentication #10

njtalba5127 opened this issue Dec 8, 2022 · 2 comments · Fixed by #26 or #27
Assignees
Labels
enhancement New feature or request

Comments

@njtalba5127
Copy link
Member

njtalba5127 commented Dec 8, 2022

Timestamp: (1822) 1822 / 2207

@njtalba5127 njtalba5127 mentioned this issue Dec 8, 2022
23 tasks
@njtalba5127 njtalba5127 added the enhancement New feature or request label Dec 8, 2022
@njtalba5127 njtalba5127 self-assigned this Dec 8, 2022
@njtalba5127
Copy link
Member Author

create new file called "SecurityConfig.java" inside of a new package called "config"

.
└── backend
    ├── HELP.md
    ├── mvnw
    ├── mvnw.cmd
    ├── pom.xml
    ├── src
    │   ├── main
    │   │   ├── java
    │   │   │   └── com
    │   │   │       └── nellyxinwei
    │   │   │           └── backend
    │   │   │               ├── BackendApplication.java
    │   │   │               ├── config
    │   │   │               │   └── SecurityConfig.java
    │   │   │               └── controllers
    │   │   │                   └── GreetingsController.java

SecurityConfig.java

package com.nellyxinwei.backend.config;

import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;

@EnableWebSecurity
public class SecurityConfig {

  @Bean
  public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
    http
        .authorizeRequests()
        .anyRequest()
        .authenticated()
        .and()
        .httpBasic();
    return http.build();
  }

}

@njtalba5127
Copy link
Member Author

now on next part lets see whats change. they said instead of form login, itll just be a http basic. lets check that out

This was linked to pull requests Dec 16, 2022
Repository owner moved this from In Progress to Done in 2223-1202WinterFuyu-Projects Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment