Coder Social home page Coder Social logo

Comments (3)

ch4mpy avatar ch4mpy commented on June 13, 2024

This is quite strange:
AccessTokenBuilderHelper.java:61 provides explicitely Authorization::setPermissions with a List<Permission> which is (implements) a Collection<Permission>

Do you have executable code somewhere?

If not, could you clone my repo and update com.c4_soft.springaddons.samples.webmvc.keycloak.KeycloakSpringBootSampleApp to reproduce? (currently the tests pass...)

from spring-addons.

ch4mpy avatar ch4mpy commented on June 13, 2024

By the way, @KasperVaessen , did you carfully inspect your test classpath? Have you double checked the version of the keycloak-core that is loaded?

Maybe you did not include keycloak dependencies explicitly in your project and it is just missing when your test run: in this repo, Keycloak dependencies are flagged as optional => you must reference keycloak libs explicitely if you use it.

Libs in this repo can be used without Keycloak libs (I personally don't use Keycloak libs any more), reason for keycloak being flaged as optional here.

You could try with somthing like that in your pom:

	<properties>
		<com.c4-soft.springaddons.version>3.1.7-jdk1.8-SNAPSHOT</com.c4-soft.springaddons.version>
		<keycloak.version>15.0.2</keycloak.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.keycloak.bom</groupId>
				<artifactId>keycloak-adapter-bom</artifactId>
				<version>${keycloak.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>com.c4-soft.springaddons</groupId>
				<artifactId>spring-security-oauth2-test-addons</artifactId>
				<version>${com.c4-soft.springaddons.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.keycloak</groupId>
			<artifactId>keycloak-spring-security-adapter</artifactId>
			<optional>false</optional><!-- default value is false, so removing this tag should work as well -->
		</dependency>
		<dependency>
			<groupId>com.c4-soft.springaddons</groupId>
			<artifactId>spring-security-oauth2-test-addons</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

from spring-addons.

KasperVaessen avatar KasperVaessen commented on June 13, 2024

Thanks for both your replies! It was indeed a problem with my keycloak version. I used a dependencyManager which set the keycloak version to 4.0.0.FINAL. I oversaw this.
Sorry for the trouble an thank you so much for your help!

from spring-addons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.