Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokenprovider is not working with Authorization class #118

Open
alexz707 opened this issue Jun 20, 2024 · 0 comments
Open

Tokenprovider is not working with Authorization class #118

alexz707 opened this issue Jun 20, 2024 · 0 comments

Comments

@alexz707
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant