Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Unable to change user folder path in OAuth authentication - AEM 6.5

ankur_rajput
Level 2
Level 2

I have integrated a Google OAuth2 provider with AEM 6.5 OAuth authentication handler. There is a method named getUserFolderPath in Provider interface which should be used to get the folder path under which the user should be created. I noticed that this method is never been called and instead "user.pathPrefix" property is used to get the folder path which automatically appends the first 4 chars of the user ID internally.

 

DefaultSyncHandlerConfi.PNG

 

I am not able to get the need of Sync handler for OAuth and how can I change the folder path as per my requirements? What is the need of getUserFolderPath in Provider interface?

1 Accepted Solution
vanegi
Correct answer by
Employee
Employee

This getUserFolderPath method returns the node path where the user should be created:

String getUserFolderPath(String userId,
                       String clientId,
                       Map<String,Object> props)
Return the node path where the user should be created

Parameters: userId - clientId - in use when creating this user props - map of all provider's properties for this user Returns: relative path to store this user within /home/users (e.g. "facebook/1234" might be appropriate for facebook user with id=12345678)

View solution in original post

2 Replies
vanegi
Correct answer by
Employee
Employee

This getUserFolderPath method returns the node path where the user should be created:

String getUserFolderPath(String userId,
                       String clientId,
                       Map<String,Object> props)
Return the node path where the user should be created

Parameters: userId - clientId - in use when creating this user props - map of all provider's properties for this user Returns: relative path to store this user within /home/users (e.g. "facebook/1234" might be appropriate for facebook user with id=12345678)

View solution in original post

ankur_rajput
Level 2
Level 2
This is what documentation says. But actually the path which will be used to create the user will be from the corresponding sync handler. (Also, I agree to the point that AEM automatically creates the corresponding config, but in my case I want to add it manually).