Oauth Record Secret Changes When Application Installed on Another Instance

kelly89
Tera Contributor

Hi,

An application we are testing has an Oauth application record included in its scope.  When the application is installed on our testing instance, the record comes along with the app and has the same client ID (good).  However, the client secret appears to get messed up (bad).

I.e. - If the secret was originally "Kelly", it gets changed to something with unknown characters like 
﷞﷟﷒dc5d537697a211108ed13a121153af7b﷬﷔1﷬﷭5Rpzuh2ZYP2RfHA2HbbX4w==df79Q00QXgrvWLoH3VCAJnObR464﷮

How can I get the client secret to stay the same when the application is installed on another instance?  We use it for API authentication and would rather not require the end user to have to set up another on their own.

Thanks,
Kelly

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

Hi, Client secret is password2 encrypted and so I would expect the 'value' to be different in each instance until you decrypt, as encryption will be different in each instance.

/nav_to.do?uri=sys_dictionary.do?sys_id=803680b521120110a866589604c20d63%26sysparm_view=default

 

Example from PDI

 

var test = new GlideRecord('oauth_entity');
test.get('bf973fb473331300b8d77a2f1bf6a74a');

var password = test.client_secret.getDecryptedValue();
gs.addInfoMessage('Decrypted Password: ' + password);

 

 

How are you transferring the data between instances?

 

Edit: This may have an answer for you, although it may be easier to transfer the oauth record and then update the client_secret manually.

Considerations when importing records containing KMF encrypted Password2 fields - Support and Troubl...

 

View solution in original post

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, Client secret is password2 encrypted and so I would expect the 'value' to be different in each instance until you decrypt, as encryption will be different in each instance.

/nav_to.do?uri=sys_dictionary.do?sys_id=803680b521120110a866589604c20d63%26sysparm_view=default

 

Example from PDI

 

var test = new GlideRecord('oauth_entity');
test.get('bf973fb473331300b8d77a2f1bf6a74a');

var password = test.client_secret.getDecryptedValue();
gs.addInfoMessage('Decrypted Password: ' + password);

 

 

How are you transferring the data between instances?

 

Edit: This may have an answer for you, although it may be easier to transfer the oauth record and then update the client_secret manually.

Considerations when importing records containing KMF encrypted Password2 fields - Support and Troubl...

 

Thanks Tony!  Didn't realize the encryption key changed across instances.  Thanks for the help!