Download the PHP package elidrissidev/magento-api2basicauth without Composer

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

Elidrissidev_Api2BasicAuth

This is a Magento 1.9/OpenMage extension that will add support for HTTP Basic Authentication in Api2 by introducing a new concept of "REST Users", which unlike the built-in OAuth adapter, doesn't require any human interaction and can be used to authenticate scripts and backends.

Installation

Manual

  1. Download the latest release and unpack it.

  2. Copy the app folder to the root of your magento store (choose the option to merge it with the existing content if prompted).

  3. Go to System / Cache Management and click "Flush Magento Cache" button on the top.

  4. To verify if the installation was successfull, look for a new option in System / Web Services menu called REST - Users. If you can't see it, make sure your admin user has permissions.

Composer

For OpenMage users, you can install this package easily by using composer:

Now you're ready to start using it!

Usage

Please do read the note below first.

If the installation is done properly, you should see a new option in System / Web Services menu called REST - Users, that's where you'll be able to create and manage the users that will be able to connect to the REST Api through Basic authentication.

Creating a user is not enough though, you'll have to give it access to some resources. This can be done the same way as usual by creating a REST Admin Role (System / Web Services / REST - Roles), then assigning it the user you created. Similarly, you'll have to also decide which resource attributes your REST users will have access to by going to System / Web Services / REST - Attributes, selecting REST User from the grid and selecting them from there.

Now you're ready to issue your first request! But first, you'll have to generate your authentication token, that is done by joining your username and password (Api key) with a colon (:) and encoding them in base64 (replace <username> and <password> with your own):

You can now issue requests using your token (replace <token> with your own):

If you get Access denied error, check that the role assigned to your user has access to the resource you're trying to access, and that your user is active. Additionally, you can check the logs.

Note: you may have noticed that this extension adds some new files to app/code/local. Those files are required to be able to use Basic authentication with the built-in REST endpoints in Magento, and because of the way it works, you need to add them in the same namespace as the module concerned (i.e. adding them inside the extension won't work). You can choose to not add them if you don't care about that.

A note about Basic authentication

Basic authentication is generally discouraged nowadays because it involves transfering user credentials over the network in base64 encoding, which can easily be decoded and viewed in plaintext. It is highly recommended that you use it only with an encrypted connection, and never issue requests from the client side as to not expose user credentials.

Conflicting extensions

Contributing

Please feel free to open an Issue if you find any bug, or have something to suggest. Translations to other languages are very welcome :).

License

This project is licensed under the MIT License.


All versions of magento-api2basicauth with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
openmage/magento-lts Version >=19.4.0
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 elidrissidev/magento-api2basicauth contains the following files

Loading the files please wait ....