Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jans-auth-server): introspection endpoint must return 401 when ORM throws "Failed to find entry" exception #7772

Closed
2 tasks
yuriyz opened this issue Feb 19, 2024 · 0 comments · Fixed by #7810
Assignees
Labels
comp-jans-auth-server Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality

Comments

@yuriyz
Copy link
Contributor

yuriyz commented Feb 19, 2024

Description

Introspection should return 401 instead of 500 when ORM throws "Failed to find entry" exception.

io.jans.orm.exception.EntryPersistenceException: Failed to find entry: 'tknCde=eb045d78d273107348b0300c01d29b7552d622abbc6faf81b3ec55359aa9950c,ou=tokens,o=jans'
	at io.jans.orm.sql.impl.SqlEntryManager.find(SqlEntryManager.java:380) ~[jans-orm-sql-1.0.21.jar:?]
	at io.jans.orm.impl.BaseEntryManager.find(BaseEntryManager.java:702) ~[jans-orm-core-1.0.21.jar:?]
	at io.jans.orm.impl.BaseEntryManager.find(BaseEntryManager.java:581) ~[jans-orm-core-1.0.21.jar:?]
	at io.jans.orm.impl.BaseEntryManager.find(BaseEntryManager.java:568) ~[jans-orm-core-1.0.21.jar:?]
	at jdk.internal.reflect.GeneratedMethodAccessor84.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38) ~[weld-core-impl-4.0.3.Final.jar:4.0.3.Final]
	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:106) ~[weld-core-impl-4.0.3.Final.jar:4.0.3.Final]
	at io.jans.orm.PersistenceEntryManager$EntityManager$2057902728$Proxy$_$$_WeldClientProxy.find(Unknown Source) ~[jans-orm-core-1.0.21.jar:?]
	at io.jans.as.server.service.GrantService.load(GrantService.java:168) ~[classes/:?]
	at io.jans.as.server.service.GrantService.getGrantByCode(GrantService.java:154) ~[classes/:?]
	at io.jans.as.server.model.common.AuthorizationGrantList.getAuthorizationGrantByAccessToken(AuthorizationGrantList.java:248) ~[classes/:?]
	at io.jans.as.server.service.token.TokenService.getAuthorizationGrant(TokenService.java:106) ~[classes/:?]
	at io.jans.as.server.service.token.TokenService.getBearerAuthorizationGrant(TokenService.java:94) ~[classes/:?]
	at io.jans.as.server.introspection.ws.rs.IntrospectionWebService.getAuthorizationGrant(IntrospectionWebService.java:269) ~[classes/:?]
	at io.jans.as.server.introspection.ws.rs.IntrospectionWebService.validateAuthorization(IntrospectionWebService.java:119) ~[classes/:?]
	at io.jans.as.server.introspection.ws.rs.IntrospectionWebService.introspect(IntrospectionWebService.java:149) ~[classes/:?]
	at io.jans.as.server.introspection.ws.rs.IntrospectionWebService.introspectPost(IntrospectionWebService.java:104) ~[classes/:?]
	at io.jans.as.server.introspection.ws.rs.IntrospectionWebService$Proxy$_$$_WeldClientProxy.introspectPost(Unknown Source) ~[classes/:?]

Test cases and code coverage

  • Write unit test to cover added/changed code
  • Update integration tests to cover added/changed code
@yuriyz yuriyz self-assigned this Feb 19, 2024
@mo-auto mo-auto added comp-jans-auth-server Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality labels Feb 19, 2024
yuriyz added a commit that referenced this issue Feb 22, 2024
…M throws "Failed to find entry" exception #7772

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
yuriyz added a commit that referenced this issue Feb 22, 2024
…M throws "Failed to find entry" exception #7772 (#7810)

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
devrimyatar pushed a commit that referenced this issue Feb 27, 2024
…M throws "Failed to find entry" exception #7772 (#7810)

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
Signed-off-by: Mustafa Baser <mbaser@mail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-auth-server Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
2 participants