내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

TokenUtil.createCredentials(..) replacement in 6.1 - programmatically login within a servlet?

Avatar

Level 1

Hi everyone!

We have an application that authenticates users against an independent service (front end); once users have been authenticated we direct them to a portion of the site that is protected via CUG, that means we have groups of users that are tied to a single AEM account.

In AEM 5.6.1 we were able to accomplish this by using the code below:

AuthenticationInfo authInfo = TokenUtil.createCredentials(request, response, repository, [AEM User ID], true);

Now that loginAdministrative(null) has been deprecated, this function no longer allows us to create a valid session with AEM.

Is there a replacement for the TokenUtil.createCredentials(...).

On the FrontEnd side we have no knowledge of the AEM user name / password so following the route of creating a custom authentication handler may not be a suitable solution. From what I've seen most authentication code depends on request parameter /attributes. In our case we identify the appropriate AEM user on a servlet based on its category once it's been authenticated with the remote service.

 is there a way to create the authentication info (session / token) from a servlet that is not an authentication handler?

 

Thanks in advance!

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

Hi,

If you are checking the credentials after the login authentication, why were you using loginAdministrative(null) ?? You should get the session from the logged in User.

I am not sure, if I understand your usecase. Can you please explain in detail ?

However, loginAdministrative(null) but not TokenUtil.createCredentials().

원본 게시물의 솔루션 보기

2 답변 개

Avatar

Level 9

Hi there,

I don't think this API is deprecated. Here is the doc of the API.

https://docs.adobe.com/docs/en/aem/6-1/ref/javadoc/

By the way, What is your AEM version?.

--Jitendra

Avatar

정확한 답변 작성자:
Level 10

Hi,

If you are checking the credentials after the login authentication, why were you using loginAdministrative(null) ?? You should get the session from the logged in User.

I am not sure, if I understand your usecase. Can you please explain in detail ?

However, loginAdministrative(null) but not TokenUtil.createCredentials().