Giter VIP home page Giter VIP logo

auth-jwt's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar devanych avatar eluhr avatar fantom409 avatar luizcmarin avatar rustamwin avatar samdark avatar sankaest avatar strorch avatar terabytesoftw avatar viktorprogger avatar vjik avatar wiperawa avatar xepozz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auth-jwt's Issues

JWT encrypted with RS256 instead of HS256

What steps will reproduce the problem?

I am using an RS256 algorithm instead of the (default) HS256 algorithm. RS256 uses a public/private key pair instead of a secret. The TokenManager only implements the possibility to define a secret but not a public or private file path or encryption key.

config/web/auth.php

<?php

declare(strict_types=1);

/** 
 * @var array $params
 */

use Jose\Component\Signature\Algorithm\RS256;
use Yiisoft\Auth\Jwt\TokenManagerInterface;
use Yiisoft\Auth\Jwt\TokenManager;
use Yiisoft\Auth\AuthenticationMethodInterface;
use Yiisoft\Auth\Jwt\JwtMethod;

return [
    TokenManagerInterface::class => [
        '__class' => TokenManager::class,
        '__construct()' => [
             // `secret` not needed for this algorithm, but must be defined for the token manager constructor
            'secret' => $params['yiisoft/auth-jwt']['secret'],
            'algorithms' => [new RS256()]
           // where do i define the public/private key file path or the encryption key?
        ]
    ],
    AuthenticationMethodInterface::class => JwtMethod::class
];

What is the expected result?

A possibility to define a public and private key file path for the token manager and the secret not to be a default

What do you get instead?

No possibility to use a JWT with RS256 algorithm

Additional info

Q A
Version dev-master#cc62114
PHP version 7.4.12
Operating system Docker yiisoftware/yii-php:7.4-apache

Update `web-token/*` library

What steps will reproduce the problem?

composer update

What is the expected result?

Outdated packages are not installed.

What do you get instead?

composer: Package web-token/* is abandoned, you should avoid using it. Use web-token/jwt-library instead.

Additional info

Q A
Version 2.0.1
PHP version 8.3
Operating system macOS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.