목차
구문
Java에서 인증은 어떻게 작동하나요?
인증 Java 예시
예시 #3
결론
Java java지도 시간 인증 자바

인증 자바

Aug 30, 2024 pm 03:58 PM
java

인증 java는 웹 애플리케이션의 신원 확인을 위한 보안 용어입니다. 프로그래밍 언어를 이용하여 웹사이트 및 웹 애플리케이션의 사용자 식별을 확인하는 기능입니다. 이는 사용자의 사용을 확인하고 Java 기술을 사용하여 웹사이트, 애플리케이션 및 소프트웨어 관련 제품에 액세스할 수 있도록 허용합니다. 자바 언어의 보안 용어를 이용하여 인가된 사용자를 식별하고 애플리케이션 사용 권한을 부여하는 보안 방식입니다.

무료 소프트웨어 개발 과정 시작

웹 개발, 프로그래밍 언어, 소프트웨어 테스팅 등

고유한 콘텐츠를 사용하고 보안 비밀번호와 사용자 신원을 확인하는 클라이언트 및 서버 측 기능입니다. 클라이언트측에서는 사용자 ID와 비밀번호를 사용하며, Java 프로그래밍 언어를 사용하여 실제 식별을 통해 서버측 데이터에 접근합니다. 안전한 웹 애플리케이션을 유지하고 접근 가능한 팀원만 사용하기 위한 문서화 프로세스입니다.

구문

이 구문은 학생, 교사, 비교직원, 교장 등 사용자의 특정 부서를 인증하는 데 사용됩니다. 사용자 이름, 이메일 ID, 비밀번호를 사용하여 로그인하고 본인 확인을 할 수 있습니다.

이 구문에서 애플리케이션은 인증을 위해 사용자 이름과 비밀번호를 사용합니다.

public class AppSecurityConfig extends AppSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder authentic) throws Exception {
UserBuilder userid = User.withDefaultPasswordEncoder();
authentic.inMemoryAuthentication()
.withUser(usersid.username("merry").password("test@123").roles("student"))
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/").hasRole("student")
.and()
.formLogin()
.loginPage("/useLoginPage")
.loginProcessingUrl("/authenticatationUser")
.permitAll()
.and()
.logout().permitAll();
}
}
로그인 후 복사

Java에서 인증은 어떻게 작동하나요?

보안 및 로그인 양식이 포함된 웹 애플리케이션을 사용하세요. 이 양식은 JSP 페이지로 리디렉션됩니다.

<form:form action="${pageContext.request.contextPath}/authenticateUser"
Method = "POST">
<c:if test = "${param.error ! = null}">
<b class="failed"> username/password does not authenticate here… </b>
</c:if>
<p>
User ID: <input type = "text" name = "name" />
</p>
<p>
Password: <input type = "password" name = "pswrd" />
</p>
<input type = "submit" value = "Submit" />
</form:form>
로그인 후 복사

로그인 양식 인증을 위해 웹 애플리케이션을 사용하세요. 이 양식은 JSP 페이지로 리디렉션됩니다.

<p>
User: <security:authentication property = "principal.username" />
</p>
로그인 후 복사

Java Spring 프레임워크를 사용하여 Java 인증 구문을 사용합니다. Java는 Spring 보안을 사용하여 권한을 인증합니다.

public class AppSecurityConfig extends AppSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder authentic) throws Exception {
UserBuilder userid = User.withDefaultPasswordEncoder();
authentic.inMemoryAuthentication()
.withUser (usersid.username ("merry")
.password ("test@123")
.roles ("student"))
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/")
.hasRole("student")
.and()
.formLogin()
.loginPage("/useLoginPage")
.loginProcessingUrl("/authenticatationUser")
.permitAll()
.and()
.logout().permitAll();
}
}
로그인 후 복사

인증 Java 예시

다음은 예시입니다.

예시 #1

기본적인 예시는 아래와 같습니다.

코드:

파일: authenticateApp.java

public class authenticationApp extends AppSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder authentic) throws Exception {
UserBuilder userid = User.withDefaultPasswordEncoder();
authentic.inMemoryAuthentication()
.withUser (usersid.username ("sunny")
.password ("school@123")
.roles ("student"))
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/")
.hasRole("student")
.and()
.formLogin()
.loginPage("/useLoginPage")
.loginProcessingUrl("/authenticatationUser")
.permitAll()
.and()
.logout().permitAll();
}
}
로그인 후 복사

파일: main_login.jsp

<form:form action="${pageContext.request.contextPath}/authenticateUser"
Method = "POST">
<c:if test = "${param.error ! = null}">
<b class="failed"> username/password does not authenticate here… </b>
</c:if>
<p>
User ID: <input type = "text" name = "name" />
</p>
<p>
Password: <input type = "password" name = "pswrd" />
</p>
<input type = "submit" value = "Submit" />
</form:form>
File: authentication.jsp

User name:

로그인 후 복사

출력:

인증 자바

출력

인증 자바

설명:

  • 여기에는 단일 사용자 이름으로 단일 사용자 인증이 표시됩니다.
  • 써니는 Java 인증을 통해서만 학생 포털에 접속합니다.
  • 단일 정품 사용자에 대한 단일 양식을 받게 됩니다.

예시 #2

Java 예제와 출력의 두 가지 인증은 다음과 같습니다.

코드:

파일: authenticateApp.java

public class authenticationApp extends AppSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder authentic) throws Exception {
UserBuilder userid = User.withDefaultPasswordEncoder();
authentic.inMemoryAuthentication()
.withUser (usersid.username ("merry")
.password ("test@123")
.roles ("student"))
.withUser(users.username("sam")
.password("exam@123")
.roles("student", "teacher"))
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/").hasRole("student")
.antMatchers("/teachers/**").hasRole("teacher")
.and()
.formLogin()
.loginPage("/useLoginPage")
.loginProcessingUrl("/authenticatationUser")
.permitAll()
.and()
.logout().permitAll();
}
}
로그인 후 복사

파일: main_login.jsp

<form:form action="${pageContext.request.contextPath}/authenticateUser"
Method = "POST">
<c:if test = "${param.error ! = null}">
<b class="failed"> username/password does not authenticate here… </b>
</c:if>
<p>
User ID: <input type = "text" name = "name" />
</p>
<p>
Password: <input type = "password" name = "pswrd" />
</p>
<input type = "submit" value = "Submit" />
</form:form>
File: authentication.jsp

User:
Teachrs portal

로그인 후 복사

출력:

인증 자바

출력:

인증 자바

설명:

  • 여기서 단일 사용자 이름에 두 개의 인증이 표시됩니다.
  • 'sam'은 Java 인증을 통해 교사 및 학생 포털에 액세스합니다.
  • 여러 명의 실제 사용자를 위한 단일 양식이 제공됩니다.

예시 #3

Java 예제와 출력의 다중 인증은 아래와 같습니다.

코드:

파일: authenticateApp.java

public class authenticationApp extends AppSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder authentic) throws Exception {
UserBuilder userid = User.withDefaultPasswordEncoder();
authentic.inMemoryAuthentication()
.withUser (usersid.username ("merry")
.password ("test@123")
.roles ("student"))
.withUser(users.username("sam")
.password("exam@123")
.roles("student", "teacher"))
.withUser(users.username("Ram")
.password("admin@123")
.roles("student", "teacher", "principle"))
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/")
.hasRole("student")
.antMatchers("/teachers/**").hasRole("teacher")
.antMatchers("/principles/**").hasRole("principle")
.and()
.formLogin()
.loginPage("/useLoginPage")
.loginProcessingUrl("/authenticatationUser")
.permitAll()
.and()
.logout().permitAll();
}
}
로그인 후 복사

파일: main_login.jsp

<form:form action="${pageContext.request.contextPath}/authenticateUser"
Method = "POST">
<c:if test = "${param.error ! = null}">
<b class="failed"> username/password does not authenticate here… </b>
</c:if>
<p>
User ID: <input type = "text" name = "name" />
</p>
<p>
Password: <input type = "password" name = "pswrd" />
</p>
<input type = "submit" value = "Submit" />
</form:form>
File: authentication.jsp

User:
Teachers portal
Principle portal

로그인 후 복사

출력:

인증 자바

출력:

인증 자바

설명:

  • 여기서 단일 사용자 이름에 여러 개의 인증이 표시됩니다.
  • 'Ram'은 Java 인증을 통해 교사, 학생 및 관리자 포털에 액세스합니다.
  • 여러 명의 실제 사용자를 위한 단일 양식이 제공됩니다.

결론

Java 인증은 데이터와 권한에 대한 보안, 안전, 개인정보 보호를 제공합니다. 인증은 각 사용자 및 권한에 대해 데이터베이스의 일부에 액세스하는 데 사용됩니다. 쉽고 매력적이며 사용자 친화적이고 우아한 웹사이트와 웹 애플리케이션이 됩니다. 이 기능은 사용자의 신원에 따라 문서를 정렬하고 필요한 데이터만 반환합니다. 타인의 사생활을 침해하지 않으면서 복잡한 정보를 쉽게 얻을 수 있도록 도와줍니다.

위 내용은 인증 자바의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

자바의 제곱근 자바의 제곱근 Aug 30, 2024 pm 04:26 PM

자바의 제곱근

자바의 완전수 자바의 완전수 Aug 30, 2024 pm 04:28 PM

자바의 완전수

Java의 난수 생성기 Java의 난수 생성기 Aug 30, 2024 pm 04:27 PM

Java의 난수 생성기

자바의 웨카 자바의 웨카 Aug 30, 2024 pm 04:28 PM

자바의 웨카

자바의 암스트롱 번호 자바의 암스트롱 번호 Aug 30, 2024 pm 04:26 PM

자바의 암스트롱 번호

Java의 스미스 번호 Java의 스미스 번호 Aug 30, 2024 pm 04:28 PM

Java의 스미스 번호

Java Spring 인터뷰 질문 Java Spring 인터뷰 질문 Aug 30, 2024 pm 04:29 PM

Java Spring 인터뷰 질문

Java 8 Stream foreach에서 나누거나 돌아 오시겠습니까? Java 8 Stream foreach에서 나누거나 돌아 오시겠습니까? Feb 07, 2025 pm 12:09 PM

Java 8 Stream foreach에서 나누거나 돌아 오시겠습니까?

See all articles