Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom Login Form Added For Form Based Authentication
- Loading branch information
Showing
4 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 characters
16 changes: 16 additions & 0 deletions
16
src/main/java/com/example/springsecuritydemo/controller/TemplateController.java
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.springsecuritydemo.controller; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequestMapping("/") | ||
public class TemplateController { | ||
|
||
@GetMapping("login") | ||
public String getLoginView() { | ||
return "login"; | ||
} | ||
|
||
} |
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
<title>Please sign in</title> | ||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> | ||
<link href="https://getbootstrap.com/docs/4.0/examples/signin/signin.css" rel="stylesheet" crossorigin="anonymous"/> | ||
<style> | ||
body { | ||
background-color: #3e3e3e; | ||
color:white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<form class="form-signin" method="post" action="/login"> | ||
<h2 class="form-signin-heading">Scrutiny Login Page</h2> | ||
<p> | ||
<label for="username" class="sr-only">Username</label> | ||
<input type="text" id="username" name="username" class="form-control" placeholder="Username" required autofocus> | ||
</p> | ||
<p> | ||
<label for="password" class="sr-only">Password</label> | ||
<input type="password" id="password" name="password" class="form-control" placeholder="Password" required> | ||
</p> | ||
<button class="btn btn-lg btn-primary btn-block" type="submit">Login</button> | ||
</form> | ||
</div> | ||
</body></html> |