Skip to content

Instantly share code, notes, and snippets.

@phi1ipp
phi1ipp / gist:e974da6c1c42114819fbdd4cf2c25cf2
Created December 18, 2017 22:16
UCM driver properties setup
connect(userConfigFile='/opt/ORACLE/scripts/identity/wl.conf', userKeyFile='/opt/ORACLE/scripts/identity/wl.key', url='t3://aaaaa.zzzzzz.com:7001')
domainRuntime()
HumanWFobj = ObjectName('oracle.as.soainfra.config:Location=wls_soa1,name=human-workflow,type=HWFMailerConfig,Application=soa-infra')
#set notification mode
mbs.setAttribute(HumanWFobj, Attribute('HWFMailerNotificationMode','EMAIL'))
#set email addresses
@phi1ipp
phi1ipp / gist:e7370cd8d894a882c091bb33be11b5bd
Created December 20, 2017 12:40
password generation with a password policy attached to a resource
UserRepository ur = new DBUserRepository();
UserInfo user = ur.getUserInfo(userKey);
ResourceRepository rrepo = new ResourceDBRepository();
Resource resource = rrepo.findResource(resourceName);
@phi1ipp
phi1ipp / gist:1d146e2e2fbcce2c32e4dffdf140670a
Last active January 21, 2022 11:23
Okta event hook lambda example
const okta = require('@okta/okta-sdk-nodejs');
const client = new okta.Client({
orgUrl: 'https://dev-xxxxx.oktapreview.com/',
token: 'xxxxxx'
});
exports.handler = async (event) => {
if (event.requestContext.http.method === 'POST') {
console.log('data event with body: ', event.body);
@phi1ipp
phi1ipp / gist:5460903d58d62ea17be0774c331f27aa
Created November 19, 2020 22:55
WLST password recovery for WebLogic datastores
#!/prod/app/oracle/iammiddleware/oracle_common/common/bin/wlst.sh
import os
import weblogic.security.internal.SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService
def decrypt(domainHomeName, encryptedPwd):
domainHomeAbsolutePath = os.path.abspath(domainHomeName)
encryptionService = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domainHomeAbsolutePath)
ces = weblogic.security.internal.encryption.ClearOrEncryptedService(encryptionService)
clear = ces.decrypt(encryptedPwd)
#!$MW_HOME/oracle_common/common/bin/wlst.sh
domain = "$DOMAIN_HOME"
service = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)
encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(service)
print(encryption.decrypt("<encrypted_value>"))
@phi1ipp
phi1ipp / set-app.sh
Last active January 27, 2021 23:54
Provision Okta AppUser with external id #okta
OKTA_DOMAIN="your.okta.domain"
APP_ID="xxxxxxxxxxxxxxx"
while read -r line;
do
data="{
\"id\": \"$line\",
\"scope\": \"USER\",
\"profile\": {
\"externalId\": \"$line\"
},
@phi1ipp
phi1ipp / script.js
Last active March 3, 2023 15:31
How to collect Okta group membership information from a browser to figure manually assigned users vs. assigned by a rule (make sure you are not using new Group UX feature enabled)
function loop(i) {
setTimeout(() => {
fetch('https://' + domain + '/admin/users/search?sEcho=1&iColumns=9&sColumns=user.id%2Cuser.fullName%2Cuser.lastName%2Cuser.email%2Cuser.login%2Cstatus.statusLabel%2Cstatus.loginStatus%2Cstatus.statusCode%2CmanagedBy.rules&iDisplayStart=' + i +'&iDisplayLength=100&sSearch=&bRegex=false&sSearch_0=&bRegex_0=false&bSearchable_0=true&sSearch_1=&bRegex_1=false&bSearchable_1=true&sSearch_2=&bRegex_2=false&bSearchable_2=true&sSearch_3=&bRegex_3=false&bSearchable_3=true&sSearch_4=&bRegex_4=false&bSearchable_4=true&sSearch_5=&bRegex_5=false&bSearchable_5=true&sSearch_6=&bRegex_6=false&bSearchable_6=true&sSearch_7=&bRegex_7=false&bSearchable_7=true&sSearch_8=&bRegex_8=false&bSearchable_8=true&iSortingCols=1&iSortCol_0=1&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=true&bSortable_4=true&bSortable_5=false&bSortable_6=true&bSortable_7=true&bSortable_8=false&orderBy=lastName&sortDirection=asc&groupId=' + grpId)
.then(resp => resp.text())
.then(da
@phi1ipp
phi1ipp / script.js
Last active July 6, 2021 15:47
How to grab data about Okta groups from Okta Admin console
function loop(i) {
setTimeout(() => {
fetch('https://' + domain + '/admin/groups/search?iColumns=8&sColumns=id%2Cname%2CappName%2CappDisplayName%2Cdescription%2CuserCount%2CappCount%2CdirCount&orderBy=name&sortDirection=asc&maxResults=100&iDisplayStart=' + i + '&sSearch=')
.then(resp => resp.text())
.then(data => {
var json = JSON.parse(data.substring(11)); // 11 is a number of first symbols to remove from the result,
// as it's always "while(1){};"
console.log(json.aaData); // just for visual progress tracking
aaData = aaData.concat(json.aaData);
if (i < upper)
@phi1ipp
phi1ipp / run.sh
Last active June 29, 2021 20:06
OIM 12c kotlin app execution
java -cp \
kotlin-reflect.jar:kotlin-stdlib.jar:kotlin-stdlib-jdk7.jar:oimscript.jar:$MW_HOME/idm/server/client/oimclient.jar:$MW_HOME/oracle_common/modules/oracle.jrf/jrf-api.jar:$MW_HOME/oracle_common/modules/thirdparty/spring-core-4.3.20.RELEASE.jar:$MW_HOME/oracle_common/modules/thirdparty/spring-context-4.3.20.RELEASE.jar:$MW_HOME/oracle_common/modules/org.apache.commons.logging_1.2.jar:$OIM_HOME/server/idmdf/event-recording-client.jar:$OIM_HOME/server/idmdf/idmdf-common.jar:$MW_HOME/wlserver/server/lib/wlthint3client.jar:$MW_HOME/oracle_common/modules/oracle.toplink/eclipselink.jar \
MainKt t3://oim_host:oim_port $OIM_HOME/designconsole/config/authwl.conf [oim_username] | [oim_username oim_password]
@phi1ipp
phi1ipp / capture_groups.js
Last active November 3, 2021 19:32
How to get Okta Admin groups with their privileges
function loop(after) {
setTimeout(() => {
let url = '';
if (after)
url = 'https://' + domain + '/api/internal/administrators?after=' + after + '&filter=SuperOrgAdmin%2COrgAdmin%2CAppAdmin%2CUserAdmin%2CHelpDeskAdmin%2CReadOnlyAdmin%2CApiAccessManagementAdmin%2CReportAdmin%2CGroupMembershipAdmin&type=group&limit=100&expand=user%2Capps%2Cinstances%2CappAndInstances%2CuserAdminGroups%2ChelpDeskAdminGroups%2CgroupMembershipAdminGroups'
else
url = 'https://' + domain + '/api/internal/administrators?filter=SuperOrgAdmin%2COrgAdmin%2CAppAdmin%2CUserAdmin%2CHelpDeskAdmin%2CReadOnlyAdmin%2CApiAccessManagementAdmin%2CReportAdmin%2CGroupMembershipAdmin&type=group&limit=100&expand=user%2Capps%2Cinstances%2CappAndInstances%2CuserAdminGroups%2ChelpDeskAdminGroups%2CgroupMembershipAdminGroups'
fetch(url)