-
Notifications
You must be signed in to change notification settings - Fork 83
Property 'get' does not exist on type 'Credentials | CredentialsOptions'. #56
Comments
Hi there, please forward the following:
|
I followed this[https://github.com//issues/40] link to create cognitoSyncManager object
Error: Property 'CognitoSyncManager' does not exist on type 'typeof ".../node_modules/aws-sdk/global"'. AWS.config object: AWS.config.credentials object: Also, when I am trying to copy identityId from credentials object in following way |
I've run into the same issue. This worked for me. Cheers! |
Thanks @wmagda, will try this solution. |
HI All, let params = { |
I fixed this by |
Hi, I am importing this library via npm and used Angular2 Cognito Quickstart for reference but I also need to use cognitosync library which get called immediately after login. Below is the code I am trying for which I am facing many issues
Property 'get' does not exist on type 'Credentials | CredentialsOptions'.
Property 'identityId' does not exist on type 'Credentials | CredentialsOptions'.
Property 'CognitoSyncManager' does not exist on type 'typeof ".../node_modules/aws-sdk/global"'.
---------cognito.service.ts---------
` import {
AuthenticationDetails,
CognitoIdentityServiceProvider,
CognitoUser,
CognitoUserAttribute,
CognitoUserPool
} from "amazon-cognito-identity-js";
import * as AWS from "aws-sdk/global";
import * as STS from "aws-sdk/clients/sts";
import * as awsservice from "aws-sdk/lib/service";
import * as CognitoIdentity from "aws-sdk/clients/cognitoidentity";
buildCognitoCreds( idTokenJwt: string ) {
let url = 'cognito-idp.' + Environment.REGION.toLowerCase() + '.amazonaws.com/' + Environment.USER_POOL_ID;
if ( Environment.COGNITO_IDP_ENDPOINT ) {
url = Environment.COGNITO_IDP_ENDPOINT + '/' + Environment.USER_POOL_ID;
}
let logins: CognitoIdentity.LoginsMap = {};
logins[url] = idTokenJwt;
let params = {
IdentityPoolId: Environment.IDENTITY_POOL_ID,
Logins: logins
};
let serviceConfigs: awsservice.ServiceConfigurationOptions = {};
if ( Environment.COGNITO_IDENTITY_ENDPOINT ) {
serviceConfigs.endpoint = Environment.COGNITO_IDENTITY_ENDPOINT;
}
let creds = new AWS.CognitoIdentityCredentials( params, serviceConfigs );
this.setCognitoCreds( creds );
return creds;
}
authenticate( username: string, password: string ): Promise {
}`
---------cognito-sync.service---------
`import * as AWS from "aws-sdk/global";
import * as CognitoSync from "aws-sdk/clients/cognitosync";
import { CognitoSyncManager } from 'amazon-cognito-js';
initSync(): void {
this.cognitosync = new CognitoSync( { correctClockSkew: true } );
this.cognitoSyncManager = new AWS.CognitoSyncManager(); // 3rd issue
}
Please help.
The text was updated successfully, but these errors were encountered: