Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to force Liferay 7.2.1Ga2 to use my Custom Implementation
Hello,
I'm want to override OpenIdConnectUserInfoProcessorImpl. So I created my custom implementation like this (for testing) :
And I added a .config file in osgi/configs named "com.liferay.portal.security.sso.openid.connect.internal.OpenIdConnectServiceHandlerImpl.config" and containing this :
But when I restart Liferay, this error appears :
And It seems that Liferay doesn't use my custom class
Can someone help me to understand what I'm doing wrong ?
I'm want to override OpenIdConnectUserInfoProcessorImpl. So I created my custom implementation like this (for testing) :
@Component(immediate = true,
property = {
"service.ranking:Integer=100"
},
service = OpenIdConnectUserInfoProcessor.class)
public class CustomOpenIdConnectUserInfoProcessorImpl
implements OpenIdConnectUserInfoProcessor {
private static Log log = LogFactoryUtil.getLog(CustomOpenIdConnectUserInfoProcessorImpl.class);
public CustomOpenIdConnectUserInfoProcessorImpl() {
log.info("My custom is constructed ");
}
@Override
public long processUserInfo(UserInfo userInfo, long companyId)
throws PortalException {
log.info("User connected : " + userInfo.getPreferredUsername());
String emailAddress = userInfo.getEmailAddress();
String preferredUsername = userInfo.getPreferredUsername();
return 0L;
}
And I added a .config file in osgi/configs named "com.liferay.portal.security.sso.openid.connect.internal.OpenIdConnectServiceHandlerImpl.config" and containing this :
_openIdConnectUserInfoProcessor.target="(component.name=com.mycustom.sso.CustomOpenIdConnectUserInfoProcessorImpl)"
But when I restart Liferay, this error appears :
[main][OpenIdConnectServiceHandlerImpl:93] bundle com.liferay.portal.security.sso.openid.connect.impl:4.0.17 (1812)[com.liferay.portal.security.sso.openid.connect.internal.OpenIdConnectServiceHandlerImpl(3376)] : The _openIdConnectUserInfoProcessor field has thrown an exception
And It seems that Liferay doesn't use my custom class
Can someone help me to understand what I'm doing wrong ?
I did a custom implementation of a OpenIdConnectUserInfoProcessor for Liferay 7.1.3 GA 4 once. There I found that the package of OpenIdConnectUserInfoProcessor (com.liferay.portal.security.sso.openid.connect.internal) was not exported by the MANIFEST.MF, so without any further customization I was not able to use that package.
Maybe the same or a similar issue is the reason for your problem?
Here is a link to a blog post which contains the above issue as a part of the post, including a link to the source code I used. Maybe it helps.
https://liferay.dev/blogs/-/blogs/integrating-verimi-with-liferay
Maybe the same or a similar issue is the reason for your problem?
Here is a link to a blog post which contains the above issue as a part of the post, including a link to the source code I used. Maybe it helps.
https://liferay.dev/blogs/-/blogs/integrating-verimi-with-liferay
Hi Dominik,
Thanks a lot, it works like a charm !!
Did you by anychance also change the Liferay flow for the connexion ?
I need to have only a "Sign In" button that will go to my keycloak login page.
My question is similar to the one in the Thread : https://liferay.dev/forums/-/message_boards/message/110950730
Thanks a lot, it works like a charm !!
Did you by anychance also change the Liferay flow for the connexion ?
I need to have only a "Sign In" button that will go to my keycloak login page.
My question is similar to the one in the Thread : https://liferay.dev/forums/-/message_boards/message/110950730
You can at least skip the first step you mention in the thread above.
Just copy the query paramters from the URL when you click on the "OpenID Connect" button in your login page. Paste the query parameters (without the leading question mark) into the "query parameters" field in the page configuration.
Just copy the query paramters from the URL when you click on the "OpenID Connect" button in your login page. Paste the query parameters (without the leading question mark) into the "query parameters" field in the page configuration.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™