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

getFilesUrl is missing auth when using Access Manager v3 #103

Open
vsomayaji opened this issue Aug 17, 2022 · 0 comments
Open

getFilesUrl is missing auth when using Access Manager v3 #103

vsomayaji opened this issue Aug 17, 2022 · 0 comments
Assignees
Labels
status: accepted This issue is accepted as valid, but it's not being worked on yet. type: bug This issue reports a bug.

Comments

@vsomayaji
Copy link

The first step in migrating from Access Manager v2 to v3 is to remove the authKey from the client-side configuration. When you do that, URLs returned by getFilesUrl start failing with an HTTP 403 error.

It looks like the issue lies here:

if (keyset.authKey != null) 'auth': keyset.authKey!

With the PamKeysetExtension, should that be something like this instead:

if (keyset.hasAuth()) 'auth': keyset.getAuth(),

For now, we're working around this by setting the authKey to the token:

    _pubnub = pn.PubNub(
      defaultKeyset: pn.Keyset(
        // TODO: Setting the `authKey` shouldn't be necessary, but there is a bug in the PubNub SDK where
        // [PubNub.files.getFileUrl] does not use the value configured with [PubNub.setToken].
        authKey: token,
        publishKey: publishKey,
        subscribeKey: subscribeKey,
        userId: pn.UserId(userId),
      ),
    );
    _pubnub.setToken(token);
@are are self-assigned this Aug 17, 2022
@are are added status: accepted This issue is accepted as valid, but it's not being worked on yet. type: bug This issue reports a bug. labels Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted This issue is accepted as valid, but it's not being worked on yet. type: bug This issue reports a bug.
Projects
None yet
Development

No branches or pull requests

2 participants