Skip to content

Instantly share code, notes, and snippets.

@pitbulk
pitbulk / transforms_officialsite_1.2.20.h
Last active August 29, 2015 14:09
transforms.h files
/**
* XML Security Library (http://www.aleksey.com/xmlsec).
*
* The transforms engine
*
* This is free software; see Copyright file in the source
* distribution for preciese wording.
*
* Copyright (C) 2002-2003 Aleksey Sanin <[email protected]>
*/
@pitbulk
pitbulk / functions.php
Last active August 29, 2015 14:22
Fix ADFS bug (Edit wordpress-onelogin/onelogin-saml-sso/php/functions.php)
<?php
// Make sure we don't expose any info if called directly
if ( !function_exists( 'add_action' ) ) {
echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';
exit;
}
function saml_checker() {
if (isset($_GET['saml_acs'])) {
<?php
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/wp-load.php';
require_once plugin_dir_path(__FILE__)."php/functions.php";
require_once plugin_dir_path(__FILE__)."php/configuration.php";
saml_acs();
@pitbulk
pitbulk / fixpw.php
Created June 7, 2016 11:40
This script sanitize @@@nopass@@@ passwords generated by OneLogin SAML plugin <= 2.1.8
<?php
/**
* This script search user with @@@nopass@@@ passwords and replace them by random passwords
*/
/** Sets up the WordPress Environment. */
require( dirname(__FILE__) . '/wp-load.php' );
$users = get_users();
@pitbulk
pitbulk / 01 - generate_tokens.php
Last active May 11, 2017 17:27
Onelogin - OAuth 2.0 Tokens
<?php
// URL & credentials
$url = "https://api.<us or eu>.onelogin.com/auth/oauth2/token";
$client_id = "<client_id>";
$client_secret = "<client_secret>";
$data = array(
"grant_type" => "client_credentials"
);
@pitbulk
pitbulk / 01 - get_users.php
Last active March 27, 2017 21:37
Onelogin - Users API
<?php
// URL & credentials
$url = "https://api.<us or eu>.onelogin.com/api/1/users";
$access_token = "<access_token>";
// Parameters
$query_parameters = array(
// -- Search --
'directory_id' => null,
<?php
// URL & credentials
$url = "https://api.<us or eu>.onelogin.com/api/1/saml_assertion";
$access_token = "<access_token>";
// Parameters
$username_or_email = "<username_or_email>";
$password = "<password>";
$app_id = "<app_id>";
@pitbulk
pitbulk / 01 - get_roles.php
Last active March 15, 2017 21:25
Onelogin - Roles API
<?php
// URL & credentials
$url = "https://api.<us or eu>.onelogin.com/api/1/roles";
$access_token = "<access_token>";
// Parameters
$query_parameters = array(
// -- Search --
'id' => null,
@pitbulk
pitbulk / 01 - get_events.php
Last active March 27, 2017 21:44
Onelogin - Events API
<?php
// URL & credentials
$url = "https://api.<us or eu>.onelogin.com/api/1/events";
$access_token = "<access_token>";
// Parameters
$query_parameters = array(
// -- Search --
'client_id' => '',
@pitbulk
pitbulk / 01 - get_groups.php
Last active March 15, 2017 21:31
Onelogin - Groups APi
<?php
// URL & credentials
$url = "https://api.<us or eu>.onelogin.com/api/1/groups";
$access_token = "<access_token>";
// Parameters
$query_parameters = array(
// -- Search --
'id' => '',