Skip to content

Instantly share code, notes, and snippets.

@abadongutierrez
Last active February 1, 2021 06:37
Show Gist options
  • Save abadongutierrez/a42d6cb9003899cd11c9ec981365a8da to your computer and use it in GitHub Desktop.
Save abadongutierrez/a42d6cb9003899cd11c9ec981365a8da to your computer and use it in GitHub Desktop.
Micronaut Tutorial - Login with Microsoft - Home Page
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Home Page</title>
</head>
<body>
<h1>Micronaut Tutorial - Login with Microsoft</h1>
<h2 th:if="${security}">Welcome authenticated user: <span th:text="${security.attributes.user['userPrincipalName']}"></h2>
<h2 th:unless="${security}">Welcome anonymous user</h2>
<nav>
<ul>
<li th:unless="${security}"><a href="/oauth/login/microsoft">Login with Microsoft</a></li>
<li th:if="${security}"><a href="/logout">Logout</a></li>
</ul>
</nav>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment