Skip to content

Read/Write data on single-sign-on protected pages with a single line of script.

License

Notifications You must be signed in to change notification settings

jojijacobk/Access-SSO-Protected-Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Access single-sign-on protected URLs using configured credentials, and perform read/write operations.

If you are ever on a rush for an automated script to perform read/write operation on data residing behind single-sign-on protected URL, this module is for you. Just configure a working SSO username & password into config.ini file - you are done!

  • class SingleSignOn - tries to access the single-sign-on protected URL, and follows HTTP redirects to the authentication server, and pass through authentication server by posting credentials configured in config.ini file. After successful authentication, a cookie jar stores necessary cookies to perform subsequent visits to any URLs within the protected host.
  • class Data Streamer - is used to perform read/write operations on protected server resources, after successfully signing into protected hosts with the help of SignleSignOn class.

How To Install

Visit packagist for details.

  1. Install the package via composer composer require jojijacobk/access-sso-protected-data

  2. Make config.ini file in the root directory (where composer.json file resides). You can make the config.ini file either by copying it from vendor/jojijacobk/access-sso-protected-data/config.ini, or by the copying the config.ini sample as described below.

    config.ini

    ; single sign-on credentials
    [single_sign_on]
    username = [email protected]
    password = xxxxx
    
  3. Make a PHP file in the root directory (where _composer.json & config.ini resides), let's call it demo.php and write the following script to read data from single-sign-on protected page:

    demo.php

    <?php
    
    require 'vendor/autoload.php';
    
    $requestUrl_1 = "https://jira.your-company.com/jira/rest/api/2/search?jql=xxx";
    $requestUrl_2 = "https://confluence.your-company.com/confluence/rest/api/content/yyy";
    
    echo \jojijacobk\access_sso_protected_data\DataStreamer::read($requestUrl_1);
    echo \jojijacobk\access_sso_protected_data\DataStreamer::read($requestUrl_2);

Support or Contact

Github pull requests: https://github.com/jojijacobk/Access-SSO-Protected-Data

Contact me: [email protected]

About

Read/Write data on single-sign-on protected pages with a single line of script.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages