Signed-off-by: Pan Li <panli@microsoft.com>
This commit is contained in:
Pan Li 2019-02-13 01:56:47 -06:00 коммит произвёл GitHub
Родитель c60bac36fd
Коммит b3dec05f90
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 29 добавлений и 25 удалений

Просмотреть файл

@ -1,24 +1,27 @@
## How to configure
### Create your Azure Active Directory B2C Tenant
### Create your Azure Active Directory B2C tenant
Follow the guide of [AAD B2C tenant creation](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-tutorials-web-app).
Follow the guide of [AAD B2C tenant creation](https://docs.microsoft.com/en-us/azure/active-directory-b2c/tutorial-create-tenant).
### Register your Azure Active Directory B2C and create polices
### Register your Azure Active Directory B2C application
Follow the guide of [AAD B2C application registry and policies creation](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-tutorials-web-app).
Follow the guide of [AAD B2C application registry](https://docs.microsoft.com/en-us/azure/active-directory-b2c/tutorial-register-applications).
Please make sure that your b2c application `reply URL` contains `http://localhost:8080/home`.
### Create user flows
Follow the guide of [AAD B2C user flows creation](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-tutorials-web-app).
### Configure the sample
##### Azure AD B2C portal
1. Add `http://localhost:8080/home` as your Azure AD B2C application `reply URL`.
##### Application.yml
#### Application.yml
1. Fill in `${your-tenant-name}`, `${your-client-id}` and `${your-client-secret}` from Azure AD B2C portal `Applications`.
2. Fill in the `${your-sign-up-or-in-policy-value}`, `${your-profile-edit-policy-value}` and
`${your-password-reset-policy-value}` from the portal `User flows`.
3. Replace `${your-reply-url}` to `http://localhost:8080/home`.
4. Replace `${your-logout-success-url}` to `http://localhost:8080/login`.
```yaml
azure:
@ -27,30 +30,31 @@ azure:
tenant: ${your-tenant-name}
client-id: ${your-client-id}
client-secret: ${your-client-secret}
reply-url: http://localhost:8080/home # should be absolute url.
logout-success-url: http://localhost:8080/login
reply-url: ${your-reply-url} # should be absolute url.
logout-success-url: ${your-logout-success-url}
policies:
sign-up-or-sign-in: ${your-sign-up-or-in-policy-value}
profile-edit: ${your-profile-edit-policy-value}
password-reset: ${your-password-reset-policy-value}
profile-edit: ${your-profile-edit-policy-value} # optional
password-reset: ${your-password-reset-policy-value} # optional
```
##### Templates greeting.html and home.html
#### Templates greeting.html and home.html
1. Fill in the `${your-profile-edit-policy-value}` and `${your-password-reset-policy-value}` from the portal `User flows`.
Please make sure that these two placeholders should be the same as `application.yml` respectively.
### How to run
- Use Maven
* Maven
```
# Under azure-spring-boot project root directory
mvn clean install -DskipTests
cd azure-spring-boot-samples
cd azure-active-directory-b2c-oidc-spring-boot-sample
mvn spring-boot:run
```
```
# Under azure-spring-boot project root directory
mvn clean install -DskipTests
cd azure-spring-boot-samples
cd azure-active-directory-b2c-oidc-spring-boot-sample
mvn spring-boot:run
```
### Check the authentication with policies.
### Validation
1. Access `http://localhost:8080/` as index page.
2. Sign up/in.

Просмотреть файл

@ -9,5 +9,5 @@ azure:
logout-success-url: ${you-logout-success-url}
policies:
sign-up-or-sign-in: ${your-sign-up-or-in-policy-value}
profile-edit: ${your-profile-edit-policy-value}
password-reset: ${your-password-reset-policy-value}
profile-edit: ${your-profile-edit-policy-value} # optional
password-reset: ${your-password-reset-policy-value} # optional