cancel
Showing results for 
Search instead for 
Did you mean: 

Where can I find cleanOAuthRefreshTokenCronJob? Does cleanOAuthRefreshTokenCronJob exist?

geffchang
Active Contributor
0 Kudos
369

SAP Commerce Cloud version: 2205

In a SAP Infrastructure Assessment for our SAP Commerce Cloud system, SAP recommended for us to delete expired OAuthRefreshTokens using an OOTB cleanOAuthRefreshTokenCronJob. SAP says it can be found in the oauth2 extension. But, I can't find this in SAP Commerce Cloud 2205 code. I can't also find it in SAP Help nor in SAP for Me (KBA).

It is supposed to look something like this:

INSERT_UPDATE CronJob;
code[unique=true];job(code);singleExecutable;sessionLanguage(isocode)
;cleanOAuthRefreshTokenCronJob;cleanupOAuthRefreshTokenPerformable;false;de
INSERT_UPDATE Trigger;cronjob(code)[unique=true];cronExpression
; cleanOAuthRefreshTokenCronJob; 0 0/5 * ? * * *

Has cleanOAuthRefreshTokenCronJob been deprecated or removed?

Accepted Solutions (0)

Answers (2)

Answers (2)

samuelyang
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @geffchang 

It's in the latest Commerce Cloud 2211 version. 

You can find the Impex scripts at hybris/bin/platform/ext/oauth2/resources/impex/essentialdata-cleanup-oauthrefreshtoken.impex, and the Job implementation at hybris/bin/platform/ext/oauth2/resources/oauth2-spring.xml. 

Here are the screenshot taken from my Commerce Cloud 2211 instance. 

CronJob item 

samuelyang_0-1721273436902.png

Job item 

samuelyang_1-1721273508794.png

Hope it helps. 

 

kulayappa
Associate
Associate
0 Kudos

NO. It is not Deprecated. 

https://help.sap.com/doc/789b8a6e1434444da824c2493c6faaa0/2211.4/en-US/de/hybris/platform/oauth2/job...

You can find the respective strategy (de.hybris.platform.oauth2.jobs.maintenance.impl.CleanUpOAuthRefreshTokenStrategy) here oauth2-spring.xml. 


The below impex should enable the job.
{code}

INSERT_UPDATE MaintenanceCleanupJob;code[unique=true];springId[unique=true];active[default=true]
;cleanupOAuthRefreshTokenPerformable;cleanupOAuthRefreshTokenPerformable;false

INSERT_UPDATE CronJob;code[unique=true];job(code);sessionLanguage(isoCode)[default=en]
;CleanUpAccessTokenJob;cleanupOAuthRefreshTokenPerformable

INSERT_UPDATE Trigger; cronJob(code)[unique = true]; second; minute; hour; day; month; year ; relative; active; maxAcceptableDelay
; CleanUpAccessTokenJob ; 0 ;1 ; -1 ; -1 ; -1 ; -1 ; false ; true ; -1


{code}