Skip to content

Instantly share code, notes, and snippets.

@phi1ipp
phi1ipp / debug.log
Created Aug 20, 2021
error while creating app user schema attribute
View debug.log
2021-08-20T17:27:23.963-0500 [WARN] Provider "registry.terraform.io/okta/okta" produced an invalid plan for okta_app_user_schema_property.cms
-submitter-id, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .union: planned value cty.False for a non-computed attribute
- .user_type: planned value cty.StringVal("default") for a non-computed attribute
okta_app_user_schema_property.cms-submitter-id: Creating...
2021-08-20T17:27:23.964-0500 [INFO] Starting apply for okta_app_user_schema_property.cms-submitter-id
2021-08-20T17:27:23.965-0500 [DEBUG] okta_app_user_schema_property.cms-submitter-id: applying the planned Create change
2021-08-20T17:27:23.966-0500 [DEBUG] provider.terraform-provider-okta_v3.13.3: 2021/08/20 05:27:23 [DEBUG] performing request: method=POST url
=https://redacted.okta.com/api/v1/meta/schemas/apps/0oa9hwqkfuPZqlrcx297/default
@phi1ipp
phi1ipp / run.sh
Last active Jun 29, 2021
OIM 12c kotlin app execution
View run.sh
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 / script.js
Last active Jul 6, 2021
How to grab data about Okta groups from Okta Admin console
View script.js
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 / script.js
Last active Jun 8, 2021
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)
View script.js
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 / set-app.sh
Last active Jan 27, 2021
Provision Okta AppUser with external id #okta
View set-app.sh
OKTA_DOMAIN="your.okta.domain"
APP_ID="xxxxxxxxxxxxxxx"
while read -r line;
do
data="{
\"id\": \"$line\",
\"scope\": \"USER\",
\"profile\": {
\"externalId\": \"$line\"
},
View gist:4501c67bfda1c17b9d0bcd77c96d47df
#!$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 / gist:5460903d58d62ea17be0774c331f27aa
Created Nov 19, 2020
WLST password recovery for WebLogic datastores
View gist:5460903d58d62ea17be0774c331f27aa
#!/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)
@phi1ipp
phi1ipp / gist:1d146e2e2fbcce2c32e4dffdf140670a
Last active Nov 19, 2020
Okta event hook lambda example
View gist:1d146e2e2fbcce2c32e4dffdf140670a
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:e7370cd8d894a882c091bb33be11b5bd
Created Dec 20, 2017
password generation with a password policy attached to a resource
View gist:e7370cd8d894a882c091bb33be11b5bd
UserRepository ur = new DBUserRepository();
UserInfo user = ur.getUserInfo(userKey);
ResourceRepository rrepo = new ResourceDBRepository();
Resource resource = rrepo.findResource(resourceName);
View gist:e974da6c1c42114819fbdd4cf2c25cf2
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