Skip to content

Instantly share code, notes, and snippets.

@rjozefowicz
Last active February 5, 2020 18:06
Show Gist options
  • Save rjozefowicz/d5977a07bf3821cf9350007118de5bc3 to your computer and use it in GitHub Desktop.
Save rjozefowicz/d5977a07bf3821cf9350007118de5bc3 to your computer and use it in GitHub Desktop.
spring security training
@rjozefowicz
Copy link
Author

DEBUG logs

logging.level.org.springframework.security=DEBUG

@rjozefowicz
Copy link
Author

rjozefowicz commented Feb 3, 2020

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Login page</title>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<h1>Login page</h1>
<form th:action="@{/login}" method="post" style="width: 200px">
    <div th:if="${param.loggedOut}" class="alert alert-info">
    You have been logged out
</div>
    <div class="form-group">
        <label for="username">Username</label>:
        <input class="form-control" type="text" id="username" name="username" autofocus="autofocus"/> <br/>
    </div>
    <div class="form-group">
        <label for="password">Password</label>:
        <input class="form-control" type="password" id="password" name="password"/> <br/>
    </div>
    <input type="submit" value="Log in" class="btn btn-primary"/>
</form>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
        integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
        crossorigin="anonymous"></script>
</body>
</html>

index.html logout button

<form th:action="@{/doLogout}" method="post">
    <input th:type="submit" class="btn btn-primary" th:value="Logout"/>
</form>

@rjozefowicz
Copy link
Author

InternalSystemAuthenticationProvider:

  private boolean internalSystemUser(String username) {
        return nonNull(username) && username.startsWith("agx");
    }

@rjozefowicz
Copy link
Author

View X.509 certificate details:

openssl x509 -in client.crt -text -noout

or use https://www.sslshopper.com/certificate-decoder.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment