Download the PHP package pochocho/okta-saml-sso without Composer

On this page you can find all versions of the php package pochocho/okta-saml-sso. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package okta-saml-sso

Okta SAML SSO for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provide a simple to use implementation for implementing Okta SAML Login to the app. The package assists in receiving the SAML Response and Getting the

Installation

Generate your certificate, if you want to generate a self signed certificate, you can follow the command as an example:

Note: by default, this package expects the certificate and key to be at the root of your projects directory. Remember to add both files to .gitignore

Creating and Configuring Okta App

Create your Okta app, Select SAML 2.0 as the Sign-in Method.

in the form the Single sign on URL refers to url in your app that Okta will send a POST request to after successful authentication.

Audience URI is the URL where you are publishing public information about its SAML configuration (the metadata)

Default RelayState is the URL that Okta will redirect to after successfull login.

On this form you can also set the Attribute Statements and map them to profile fields. This package assumes snake_case naming conventions on the attributes (e.g first_name, las_name, email, etc)

After configuring the app, visit the signon tab and click on the "View SAML Setup Instructions", once the page loads download the certificate file and place it in the root of your application call it idp.cert important: do not commit this file to version control

configuration

The following values must be set in hour .env

OKTA_SIGNON_URL: You can get this value from your Okta Admin Dashboard, by going to the "Sign On" tab on your SAML app and clicking on the "View SAML setup Instructions" button. Use the "Identity Provider Single Sign-On URL" value.

LOGIN_REDIRECT_ROUTE:This is the route name where you want your users to be redirected logging in.

You can also publish the configuration file by running

The package assumes that a cert and key file exist at the root directory of the project, named oktasso.crt and oktasso.key:

If your application does not use the User model for authentication, you can configure the model with the OKTA_AUTHENTICATABLE_MODEL key on the env.

Usage

Provided

The easiest way to use the package is by using the provided controllers. The package provides 2 controllers one if you are using encryption, and another if you are not. To get started register the route in the web.php routes file

NOTE: Since Okta sends a post request to the app once authentication is completed, we need to ignore the login route from csrf validation. You can do this by adding the login url to the VerifyCsrfToken middleware in the application.

Register the SsoAuthenticate Middleware in the Http Kernel. You can either substitute the auth middleware or create your own.

Add the new middleware to your auth protected routes, try loading a proteted route and you should be redirected to the Okta login flow.

Custom

You can implement your own controller and use the OktaSaml class to handle the assertions from the Okta SAML Response. The class provides two methods one for un-encrypted SAML Responses $oktaSaml->getEntity() and another for encrypted responses $oktaSaml->getEncryptedEntity().

The OktaSaml Class is bound to the IoC Container and can be resolved through dependency injection or by using app()->make(Pochocho\OktaSamlSso\OktaSaml::class);


All versions of okta-saml-sso with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1.0
illuminate/support Version 9.*|10.*|11.*
litesaml/lightsaml Version ^4.0
illuminate/auth Version 9.*|10.*|11.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pochocho/okta-saml-sso contains the following files

Loading the files please wait ....