Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

How to get the Token for API Call #106

Closed
@Nicosoft

Description

@Nicosoft

Hi there,

I am trying to create a new method in /serverice/cognito.service.ts that returns the token JWT.
I need the token because I want to call a method in AWS Gateway. This method has a Authorization (Cognito User Pool).

So I wrote the following function in /serverice/cognito.service.ts
getToken() { let token = this.getCurrentUser().getSignInUserSession().getAccessToken().getJwtToken(); console.log('### TOKEN', token); return token; }
Unfortunately this generates an error:
screen shot 2017-09-08 at 4 50 45 pm

So my question is:
How do I correctly get the Token?

Thank for your help!

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