- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 01:05 PM
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
dc5d537697a211108ed13a121153af7b15Rpzuh2ZYP2RfHA2HbbX4w==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
Solved! Go to Solution.
- Labels:
-
Oauth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 04:12 PM - edited 12-19-2022 04:15 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 04:12 PM - edited 12-19-2022 04:15 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 07:41 AM
Thanks Tony! Didn't realize the encryption key changed across instances. Thanks for the help!