Harish KM is a Cloud Evangelist and a Full Stack Engineer at QloudX. Harish is very passionate about cloud native solutions and using the best tools for projects. This means that he is an expert in a multitude of application languages and is up to date with all the new offerings and services from cloud providers, especially AWS.
6 Replies to “Using Angular to Invoke APIs Hosted on Amazon API Gateway, Secured using Cognito User Pools”
Using the secret key won’t be the right way to go if you need Cognito’s hosted UI. Instead, create a public app client in your Cognito user pool as described here. Then you would use its client ID in your angular code when you redirect your users to the Cognito hosted UI for login.
Qloudx takes your privacy and security seriously. We use cookies on this site to provide you with the best experience. By closing this banner, scrolling this page, clicking a link or continuing to browse, you agree to the use of cookies. To know more, please feel free to view our Global Privacy Policy. ACCEPT
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Simple and fixed the issue I was dealing with. Thanks for making such a simple to follow help article.
nice Work! it help me =)
Is this secure to have client-id and secret in angular code?
Authorization: ‘Basic ‘ + btoa(‘:’),
Nice catch Vik. You’re right. Putting the secret in Angular code isn’t very secure. I’ll update the post when I get a chance. Thanks! 🙂
How can we use Hosted UI for authentication in angular with secret key
Using the secret key won’t be the right way to go if you need Cognito’s hosted UI. Instead, create a public app client in your Cognito user pool as described here. Then you would use its client ID in your angular code when you redirect your users to the Cognito hosted UI for login.