Skip to content

Events API (GraphQL) can't use Lambda authMethod: Error: No auth token specifiedย #14277

@rsmogura

Description

@rsmogura

Before opening, please confirm:

JavaScript Framework

Angular

Amplify APIs

GraphQL API

Amplify Version

v6

Amplify Categories

auth

Backend

CDK

Environment information

sh: envinfo: command not found

Describe the bug

There's a bug related to authentication and overriding authentication per auth methods. Bug has been narrowed to lack of applying options from events.connect and events.subscribe methods (

const providerOptions = configure();
)

From code perspective

await events.connect(this.channelId, {
      authMode: 'lambda',
      authToken: 'asdad3s',
    });

The authToken is not included in configuring connection which results in No auth token specified error being thrown.

Similar issues (which describes problem in more details):

Expected behavior

The authToken can be used with calls to events.connect and events.subscribe

Reproduction steps

  1. Install Amplify and create sample project
  2. Configure amplify
  3. Execute following code
await events.connect(this.channelId, {
      authMode: 'lambda',
      authToken: 'asdad3s',
    });

Code Snippet

await events.connect(this.channelId, {
      authMode: 'lambda',
      authToken: 'asdad3s',
    });

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions