protected function getSubjectFromJwt(SignedJwt $jwt, ICredential $credential) : ISubject
    {
        $roles = $jwt->getPayload()->get('roles') ?: [];

        return new Subject(
            [new Principal(PrincipalTypes::PRIMARY, $jwt->getPayload()->getSubject(), $roles)],
            [$credential]
        );
    }
protected function getSubjectFromJwt(SignedJwt $jwt, ICredential $credential) : ISubject
    {
        $roles = $jwt->getPayload()->get('roles') ?: [];

        return new Subject(
            [new Principal(PrincipalTypes::PRIMARY, $jwt->getPayload()->getSubject(), $roles)],
            [$credential]
        );
    }
protected function getSubjectFromJwt ( SignedJwt $ jwt , ICredential $ credential ) : ISubject { $ roles = $ jwt -> getPayload ( ) -> get ( 'roles' ) ? : [ ] ; return new Subject ( [ new Principal ( PrincipalTypes :: PRIMARY , $ jwt -> getPayload ( ) -> getSubject ( ) , $ roles ) ] , [ $ credential ] ) ; }
Gets a subject from a JWT

@param SignedJwt $jwt The signed JWT
@param ICredential $credential The credential
@return ISubject The subject
Gets a subject from a JWT