Download the PHP package xcesaralejandro/canvasoauth without Composer

On this page you can find all versions of the php package xcesaralejandro/canvasoauth. 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 canvasoauth

Introduction

canvasoauth is a package developed for Laravel and integrates the Oauth2 credential flow in its entirety. The package provides everything you need to get started and takes care of storing and renewing user tokens.

To learn more about Oauth2 focused on canvas, you can visit the official Canvas documentation here: https://canvas.instructure.com/doc/api/file.oauth.html

Requirements

php >= 8.0

Laravel >= 8.0

Installation and configuration

1.- Add the package to your project

`

2.- Publish the provider

``

3.- Run the migrations

``

4.- Complete the configuration file

Once the providers have been published, you will have a new file called ` inside the config folder, there you will have to complete the configuration.

The variables to fill in the configuration are the credentials obtained when adding a new API developer key in canvas. While it is generating the credentials, canvas will ask you for your redirection point, use the following for all fields where you need to put a URL:

`

Going back to the configuration, at this point it may be a bit obvious what goes into each section, but I'll comment on them anyway.

VERIFY_SELF_SIGNED_HTTPS => If false, it allows you to make the required HTTP requests, ignoring that your certificate is self-signed.

CANVAS_DOMAIN_URL => The url of your Canvas instance, for example https://YOUR_INSTITUTION.instructure.com

CANVAS_CLIENT_ID => client_id generado por canvas tras agregar una nueva clave de desarrollador API.

CANVAS_CLIENT_SECRET => client_secret generado por canvas tras agregar una nueva clave de desarrollador API.

Use

First of all, note that this package manages the authorization tokens and the retrieval flow for you, in no case does it manage users. When referring to the user_id, we are referring to the one provided by canvas. If your application has its own user management, try to store a dictionary of your local identifier and the canvas identifier obtained in the granting of permissions, otherwise, you will not be able to obtain the tokens correctly.

Once you have configured the tool, the flow starts with a predefined link that is built with the credentials. This can be obtained using the following facade:

`

You can put the URL inside a link, automatic redirection or wherever you want, depending on the application you want to build. Remember that this is not authentication, rather a flow to get an authorization token. Access tokens can be infinitely regenerated, so ideally you should only ask the user for authorization once and then the package will always return a valid token.

To control the flow, use the controller `

`

On the other hand, you can manage the tokens with the ` model and in the following way:

Check if a token exists for the user

`

Returns the token for a particular user, regenerates in the background in case the token is expired. If the consulted user does not have a token or an error has occurred while regenerating the token, it will return null.

`


All versions of canvasoauth with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
guzzlehttp/guzzle Version ^7.0.1
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 xcesaralejandro/canvasoauth contains the following files

Loading the files please wait ....