Skip to content

Easily adding extra Claims to lexik/LexikJWTAuthenticationBundle

License

Notifications You must be signed in to change notification settings

leroy0211/Lexik-JWT-Claims-Extension

Repository files navigation

Lexik-JWT-Claims-Extension

Easily adding extra Claims to lexik/LexikJWTAuthenticationBundle

Work-In-Progress

Built-in Claims

  • IpAddressClaim - Will add the client's IP address to the claims

Create your own claim

To create your own claim create a new claim class by implementing the ClaimInterface. Tag it as flexsounds.lexik.claim and your claim will be added.

note If you use autoconfigure, you don't have to tag this service. It's being done for you.

Example

# App\Claims\RandomNumberClaim
class RandomNumberClaim implements ClaimInterface
{
    public function getName()
    {
        return 'random_number';
    }

    public function getValue()
    {
        return rand(0, 100);
    }
}

About

Easily adding extra Claims to lexik/LexikJWTAuthenticationBundle

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages