Skip to content

Commit

Permalink
Merge branch 'develop' into update-from-template-merged
Browse files Browse the repository at this point in the history
  • Loading branch information
xdev-gh-bot committed Jul 1, 2024
2 parents 4d22d20 + 6720304 commit 7ca2a87
Show file tree
Hide file tree
Showing 47 changed files with 2,861 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ body:
attributes:
label: "Checklist"
options:
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/spring-security-advanced-authentication-ui/releases/latest)"
required: true
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/spring-security-advanced-authentication-ui/issues) or [closed](https://github.com/xdev-software/spring-security-advanced-authentication-ui/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/spring-security-advanced-authentication-ui/issues) or [closed](https://github.com/xdev-software/spring-security-advanced-authentication-ui/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/spring-security-advanced-authentication-ui/issues) or [closed](https://github.com/xdev-software/spring-security-advanced-authentication-ui/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
required: true
Expand Down
4 changes: 2 additions & 2 deletions .run/Run Demo.run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="software.xdev.Application" />
<module name="template-placeholder-demo" />
<module name="spring-security-advanced-authentication-ui-demo" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<extension name="coverage">
<pattern>
Expand All @@ -13,4 +13,4 @@
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 1.0.2
* Fix incorrect styling of ``main`` element on login screen

# 1.0.1
* Fix NPE when ``additionalStylingData`` is not set

# 1.0.0
<i>Initial release</i>
* All methods and functionality are designed to be overwritable (at least protected)
* The library consists of 2 main parts:
* ``extendable`` → Includes the bare minimum to make the Spring components extendable
* ``advanced`` → Contains components made on top of ``extendable`` with many customization options; Additionally:
* Updated Bootstrap to version 5.3+
* Improved SSO (OAuth2 / SAML2) UI
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ You should have the following things installed:
* Ensure that the JDK/Java-Version is correct


## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/spring-security-advanced-authentication-ui/release.yml?branch=master)](https://github.com/xdev-software/spring-security-advanced-authentication-ui/actions/workflows/release.yml)

Before releasing:
* Consider doing a [test-deployment](https://github.com/xdev-software/template-placeholder/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Consider doing a [test-deployment](https://github.com/xdev-software/spring-security-advanced-authentication-ui/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Check the [changelog](CHANGELOG.md)

If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes
Expand Down
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/spring-security-advanced-authentication-ui?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/spring-security-advanced-authentication-ui)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/spring-security-advanced-authentication-ui/check-build.yml?branch=develop)](https://github.com/xdev-software/spring-security-advanced-authentication-ui/actions/workflows/check-build.yml?query=branch%3Adevelop)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_spring-security-advanced-authentication-ui&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_spring-security-advanced-authentication-ui)

# template-placeholder
# spring-security-advanced-authentication-ui

Modernizes the default Spring Web Authentication/Login UI and makes it easier customizable.

<details><summary>Show demo</summary>

<p align="center">
<img src="./assets/demo.png" alt="Demo" />
</p>

</details>

## Usage

The library provides an adapter that can be used like this:
```java
public SecurityFilterChain configure(final HttpSecurity http) throws Exception
{
// Changing the text "Login with" to "Sign in with"
http.with(new AdvancedLoginPageAdapter<>(http), c -> c
.customizeLoginPage(p -> p.ssoLoginHeaderText("Sign in with")))
.oauth2Login(c ->
// ...
)
// ...
}
```

A more detailed scenario is available in the [demo](./spring-security-advanced-authentication-ui-demo/).

## Installation
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
[Installation guide for the latest release](https://github.com/xdev-software/spring-security-advanced-authentication-ui/releases/latest#Installation)

> [!NOTE]
> To minimize the risk of dependency conflicts all Spring (Boot) dependencies are declared as provided and are not shipped by default.
## Support
If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
Expand All @@ -15,4 +45,4 @@ If you need support as soon as possible and you can't wait for any pull request,
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.

## Dependencies and Licenses
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/template-placeholder/dependencies)
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/spring-security-advanced-authentication-ui/dependencies)
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/spring-security-advanced-authentication-ui/security/advisories/new).
Binary file added assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dev_infra/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oidc-user-config.json
33 changes: 33 additions & 0 deletions dev_infra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Development Infrastructure

The infrastructure contains the following:
* [Open ID Connect Mock Server](https://github.com/Soluto/oidc-server-mock) - for login in
* Available at http://localhost:4011

### Setup
* Requires Docker

#### OIDC
* Create ``oidc-user-config.json`` from [``oidc-user-config.json.template``](./oidc-user-config.json.template)
* File should not be tracked in Git
* Fill in your login details like mail, name, password


### Usage
Note: Commands are all executed inside a shell/CMD in the current folder. ([Tip for windows users](https://stackoverflow.com/a/40146208))

| Use case | What to do? |
| --- | --- |
| Starting the infrastructure | ``docker compose up`` |
| Stopping (and removing) the infrastructure | ``docker compose down`` |
| (Re)Building the infrastructure<br/>e.g. after changes to the Dockerfiles | ``docker compose build --pull`` |

See also ``docker compose --help``

### Additional notes
⚠ The containers don't automatically restart after a PC restart!

⚠ After a PC restart the infrastructure is still present but it's stopped.<br/>
In this case you have 2 options:
* start the existing infrastructure again (``docker compose up``) or
* do a clean start by first removing (``docker compose down``) and then starting the infrastructure
69 changes: 69 additions & 0 deletions dev_infra/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: "3"

services:
# Docs: https://docs.duendesoftware.com
oidc-server-mock:
container_name: oidc-server-mock
image: ghcr.io/soluto/oidc-server-mock:9.0.1
environment:
ASPNETCORE_ENVIRONMENT: Development
SERVER_OPTIONS_INLINE: |
{
"AccessTokenJwtType": "JWT",
"Discovery": {
"ShowKeySet": true
},
"Authentication": {
"CookieSameSiteMode": "Lax",
"CheckSessionCookieSameSiteMode": "Lax"
}
}
LOGIN_OPTIONS_INLINE: |
{
"AllowRememberLogin": false
}
LOGOUT_OPTIONS_INLINE: |
{
"AutomaticRedirectAfterSignOut": true
}
USERS_CONFIGURATION_PATH: /tmp/config/oidc-user-config.json
CLIENTS_CONFIGURATION_INLINE: |
[
{
"ClientId": "client-id",
"ClientSecrets": [
"client-secret"
],
"Description": "TestClient",
"AllowedGrantTypes": [
"authorization_code",
"refresh_token"
],
"RedirectUris": [
"*"
],
"AllowedScopes": [
"openid",
"profile",
"email",
"offline_access"
],
"AlwaysIncludeUserClaimsInIdToken": true,
"AllowOfflineAccess": true,
"RequirePkce": false
}
]
ASPNET_SERVICES_OPTIONS_INLINE: |
{
"ForwardedHeadersOptions": {
"ForwardedHeaders" : "All"
}
}
volumes:
- ./oidc-user-config.json:/tmp/config/oidc-user-config.json:ro
ports:
- '4011:8080'
deploy:
resources:
limits:
memory: 512m
19 changes: 19 additions & 0 deletions dev_infra/oidc-user-config.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"SubjectId":"1",
"Username":"[email protected]",
"Password":"pwd",
"Claims": [
{
"Type": "name",
"Value": "Your name",
"ValueType": "string"
},
{
"Type": "email",
"Value": "[email protected]",
"ValueType": "string"
}
]
}
]
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>software.xdev</groupId>
<artifactId>template-placeholder-root</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>spring-security-advanced-authentication-ui-root</artifactId>
<version>1.0.3-SNAPSHOT</version>
<packaging>pom</packaging>

<organization>
Expand All @@ -15,8 +15,8 @@
</organization>

<modules>
<module>template-placeholder</module>
<module>template-placeholder-demo</module>
<module>spring-security-advanced-authentication-ui</module>
<module>spring-security-advanced-authentication-ui-demo</module>
</modules>

<properties>
Expand Down
12 changes: 11 additions & 1 deletion renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@
"packageRules": [
{
"description": "Ignore project internal dependencies",
"packagePattern": "^software.xdev:template-placeholder",
"packagePattern": "^software.xdev:spring-security-advanced-authentication-ui",
"datasources": [
"maven"
],
"enabled": false
},
{
"description": "Group Spring Boot",
"matchPackagePatterns": [
"^org.springframework.boot"
],
"datasources": [
"maven"
],
"groupName": "org.springframework.boot"
}
]
}
5 changes: 5 additions & 0 deletions spring-security-advanced-authentication-ui-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Demo

* Start the [development infrastructure](../dev_infra/)
* Run the application
* Open ``http://localhost:8080``
Loading

0 comments on commit 7ca2a87

Please sign in to comment.