Skip to content

Tokenprovider is not working with Authorization class #118

@alexz707

Description

@alexz707

Hello :)

I'm trying to use the bundle with a custom tokenprovider which is working for one part.
So I have my tokenprovider which collects all subscribeable and publishable topics and creates a token with it.

That's working fine for the backend.

For the Client I wanted to send a cookie with a token and had a look at the Authorization class.

I would like to use it but it's not compatible with the token provider. I mean it would use a TokenFactory but not a Provider.

public function createCookie(Request $request, $subscribe = [], $publish = [], array $additionalClaims = [], ?string $hub = null): Cookie

I can generate a new cookie but I need all the topics again and it's not using my token provider.

I then thought of creating the cookie myself but then I can't use the MERCURE_AUTHORIZATION_COOKIE_NAME as it's private.

Maybe I've missed something but should't it be possible to use a service which implements TokenProviderInterface with the Authorization class too?

Thanks & best Alex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions