Okta Login Wrapper
Provide an easy way for your scripts to access ressources behind an Okta SSO solution, without the need for an API token.
Prerequisite
- Python 3
- Python modules
- Requests
- lxml
- An Okta account
Installing
Simply make sure you have the required python modules installed.
pip install -r requirements.txt
Once done, place OktaLoginWrapper.py in the same folder as your own script.
Getting Started
~WARNING~ Currently the script only works if you have "push" enabled as MFA.
The main goal of this script is to help you login to an application using SSO with Okta, without requiring any API token.
As part of another scripts, it allows you to have an okta_session object from where you can connect to all application assigned to you in Okta.
from oktaloginwrapper import OktaLoginWrapper as OLW
# Create a session with your okta instance name as well as your credentials.
# If the credentials are correct, you'll be asked for MFA. (Currently only work with push notification)
my_session = OLW.OktaSession(okta_instance) #Where okta_instance is https://<okta_instance>.okta.com
my_session.okta_auth(okta_username, okta_password)
Then, depending on the type of script you are writing, here's what you can do.
As a non-interactive script:
# Use connect_to() with the 'Embed Link' of an app in Okta as parameter.
# You can find that url in Okta admin portal on the general tab of an app.
# Or by using the provided method app_list()
my_app = my_session.connect_to(app_url)
As an interactive script:
# You can prompt the user to type the name of an app he wants to log into.
# A list is returned with with corresponding apps and the user has to select which one to login to.
# If connection is successful, it returns a requests.models.response of the homepage of the app.
# From there, you can navigate the app using your object my_session.
my_app = my_session.connect_from_appslist()
Close the session once you're done.
my_session.okta_session.close()
It can also be executed but this is mainly a proof of concept as it just print the raw content. I will probably remove that part at some point in the future.
Built With
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Release files for oktaloginwrapper 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oktaloginwrapper-0.1.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oktaloginwrapper-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.5 kB
Release files / oktaloginwrapper-0.1.tar.gz
| Download URL | oktaloginwrapper-0.1.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ce0a53ec3157f486a47e241e274ff97b49116c71fa3e02f5606bdc560bd467c
|
|
BLAKE2b-256 checksum How to use checksums |
b75c6ac2956fe3e3d8581d2edf54aa268e1615ab784df34122375be12ce95c4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / oktaloginwrapper-0.1-py3-none-any.whl
| Download URL | oktaloginwrapper-0.1-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eeda08e051a408522925e3f5b1da8bfd9dfe33bfdd9afe51cadbfba63e6894a0
|
|
BLAKE2b-256 checksum How to use checksums |
c47429686af889dbb436222edf4c3a93a49ede90368bfb1312ffe6069a8ff23f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |