Error Creating bean with name 'com.microsoft.azure.spring.autoconfigure.b2c.AADB2CAutoConfiguration

Open
#942 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
azure, java, spring-boot

Research direction

Start with the dependency list in pom.xml and run mvn clean package to reproduce the reported configuration-binding failure. Compare the documented Azure AD B2C setup with the properties expected by AADB2CProperties. Done means the documented example builds without the reported bind exception.

Written by the indexing model from the issue text.

Description

This code does not work.

pom.xml

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-security</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-test</artifactId>
		<scope>test</scope>
	</dependency>

	<dependency>
		<groupId>com.microsoft.azure</groupId>
		<artifactId>azure-active-directory-b2c-spring-boot-starter</artifactId>
		<version>2.1.6.M2</version>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-thymeleaf</artifactId>
	</dependency>
	<dependency>
		<groupId>org.thymeleaf.extras</groupId>
		<artifactId>thymeleaf-extras-springsecurity5</artifactId>
	</dependency>

Code as mentioned in the docs

mvn clean package

Error thrown

Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.microsoft.azure.spring.autoconfigure.b2c.AADB2CAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.microsoft.azure.spring.autoconfigure.b2c.AADB2CAutoConfiguration$AADB2COidcAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'azure.activedirectory.b2c-com.microsoft.azure.spring.autoconfigure.b2c.AADB2CProperties': Could not bind properties to 'AADB2CProperties' : prefix=azure.activedirectory.b2c, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'azure.activedirectory.b2c' to com.microsoft.azure.spring.autoconfigure.b2c.AADB2CProperties

Dominant language
Python
Stars
66
Forks
284
Avg merge
4m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MicrosoftDocs/azure-docs-sdk-java

All issues in MicrosoftDocs/azure-docs-sdk-java

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.