Download the PHP package kriptonix/laravel-nostr-auth without Composer

On this page you can find all versions of the php package kriptonix/laravel-nostr-auth. 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 laravel-nostr-auth

laravel-nostr-auth

GitHub contributors GitHub issues GitHub last commit (branch)

This package allows users to log in to Laravel application using Nostr browser key management extensions (e.g., Alby). It enables users to authenticate by signing a message with their private key and sending the signature and public key for verification. If the verification is successful and the user is not registered in the Laravel application, the package will register the user, adding them to the users table with the corresponding public key. If the user with given public key is already registered in will be logged in.

More info about Nostr: https://github.com/nostr-protocol/nostr.

Features

Installation

To use the package in your Laravel project it is recommended to install authentication starter kits as they provide many additional features. Allthough the package will work with Laravel's built-in authentication services without starter pack you might need to tweek it a bit to adopt it to your needs.

Install the package with composer:

Install dependencies if you would like to test / code some things out for yourself.

Publish the configuration file:

Publish the migration file:

Run the migrations:

Add 'pubkey' to $fillable property of User model:

Add @stack('scripts') to layout views or static HTML pages where you want to show the "Login with Nostr" button/link.

Note: For the script to work, csrf_token should be used. When implementing the login button on static HTML pages, include the following in the section:

Add the login button:

When user clicks this button Nostr browser extension (i.e. Alby) will pop up so that user can confirm and sign a simple event message. After signing, if user with public key that signed the message exists the package will authenticate and log in the user. If user doesn't exist the package will create and log in the user.

Customization

If you would like to change the HTML of the login button, you can modify the view component located at:

Usage

Logging In

Users can log in by clicking the "Login with Nostr" button, which will use their Nostr browser key management extension to sign a message and send the signature and public key for verification.

Registration

If the user is not already registered:

Disabling Default Authentication

If you prefer to use only the Nostr authentication method, you can disable the default email/password authentication in your Laravel application.

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This package is open-sourced software licensed under the MIT license.

Community

If you need any help, please contact me via Nostr npub1ap9fscjl92zclacmaa0nneurr5js85ymuem6ew0ftu8f6eztvpds8qchga

Funding

If you would like to support this project with a donation, you could send some lightning sats to [email protected].

Maintainers


All versions of laravel-nostr-auth with dependencies

PHP Build Version
Package Version
Requires uma/phpecc Version ^0.1.3
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 kriptonix/laravel-nostr-auth contains the following files

Loading the files please wait ....