aws-amplify

AWS Cognito hosted UI and Amplify Auth with authorization code OAuth flow

谁都会走 提交于 2021-01-03 04:14:25
问题 I have a Vue.js webapp that I am trying to add simple authentication to using AWS Cognito and Amplify Auth. I have my user pool set up with "Authorization code grant" enabled for the OAuth flow. I also have the redirect URL set as https://example.auth.us-east-2.amazoncognito.com/login?response_type=code&client_id=XXXXXXXX&redirect_uri=https://example.com/auth/verify for the hosted UI. This is what's within the page the hosted UI redirects to: import { Auth } from "aws-amplify"; export default

AWS Cognito hosted UI and Amplify Auth with authorization code OAuth flow

江枫思渺然 提交于 2021-01-03 04:14:13
问题 I have a Vue.js webapp that I am trying to add simple authentication to using AWS Cognito and Amplify Auth. I have my user pool set up with "Authorization code grant" enabled for the OAuth flow. I also have the redirect URL set as https://example.auth.us-east-2.amazoncognito.com/login?response_type=code&client_id=XXXXXXXX&redirect_uri=https://example.com/auth/verify for the hosted UI. This is what's within the page the hosted UI redirects to: import { Auth } from "aws-amplify"; export default

Integrate existing AWS Cognito user pool into iOS project with Amplify

六眼飞鱼酱① 提交于 2020-12-30 06:22:08
问题 I am trying to add AWS Cognito to my iOS application using AWS Amplify. The docs suggest to use amplify add auth on the CLI, but this does not seem to work with an existing User Pool (i.e. you have to create a new one). Is it possible to integrate AWS Cognito into my iOS (Swift) project using an existing User Pool ? 回答1: Amplify CLI doesn't support existing resources at the moment but you can manually edit your awsconfiguration.json to include the User Pool that is already present as outlined

AWS Cognito - How To Get User's Group From Token Object

孤人 提交于 2020-12-29 10:14:32
问题 I can see the user's assigned User Pool group in the returned user data object in the console after logging in. Everything I've tried to assign the group to a variable has failed. What am I missing? I can easily get the client_id, JWT's, and attributes. The object path: let userGroup = user.signInUserSession.accessToken.payload.cognito.groups[0]; However, this works: user.signInUserSession.accessToken.payload.client_id; This section of the object looks like this. I can retrieve the token, the

AWS Cognito - How To Get User's Group From Token Object

*爱你&永不变心* 提交于 2020-12-29 10:07:58
问题 I can see the user's assigned User Pool group in the returned user data object in the console after logging in. Everything I've tried to assign the group to a variable has failed. What am I missing? I can easily get the client_id, JWT's, and attributes. The object path: let userGroup = user.signInUserSession.accessToken.payload.cognito.groups[0]; However, this works: user.signInUserSession.accessToken.payload.client_id; This section of the object looks like this. I can retrieve the token, the

AWS Cognito - How To Get User's Group From Token Object

孤街浪徒 提交于 2020-12-29 10:05:45
问题 I can see the user's assigned User Pool group in the returned user data object in the console after logging in. Everything I've tried to assign the group to a variable has failed. What am I missing? I can easily get the client_id, JWT's, and attributes. The object path: let userGroup = user.signInUserSession.accessToken.payload.cognito.groups[0]; However, this works: user.signInUserSession.accessToken.payload.client_id; This section of the object looks like this. I can retrieve the token, the

AWS Amplify - AppSync & Multiple DynamoDB Tables

核能气质少年 提交于 2020-12-28 15:06:55
问题 When initializing a new GraphQL backend via the Amplify CLI, the sample schema defines multiple types with the @model annotation. For example... type Blog @model { id: ID! name: String! posts: [Post] @connection(name: "BlogPosts") } type Post @model { id: ID! title: String! blog: Blog @connection(name: "BlogPosts") comments: [Comment] @connection(name: "PostComments") } type Comment @model { id: ID! content: String post: Post @connection(name: "PostComments") } When pushed, this results in

AWS Amplify - AppSync & Multiple DynamoDB Tables

和自甴很熟 提交于 2020-12-28 15:03:38
问题 When initializing a new GraphQL backend via the Amplify CLI, the sample schema defines multiple types with the @model annotation. For example... type Blog @model { id: ID! name: String! posts: [Post] @connection(name: "BlogPosts") } type Post @model { id: ID! title: String! blog: Blog @connection(name: "BlogPosts") comments: [Comment] @connection(name: "PostComments") } type Comment @model { id: ID! content: String post: Post @connection(name: "PostComments") } When pushed, this results in

AWS Amplify - AppSync & Multiple DynamoDB Tables

戏子无情 提交于 2020-12-28 15:02:32
问题 When initializing a new GraphQL backend via the Amplify CLI, the sample schema defines multiple types with the @model annotation. For example... type Blog @model { id: ID! name: String! posts: [Post] @connection(name: "BlogPosts") } type Post @model { id: ID! title: String! blog: Blog @connection(name: "BlogPosts") comments: [Comment] @connection(name: "PostComments") } type Comment @model { id: ID! content: String post: Post @connection(name: "PostComments") } When pushed, this results in

How to do field level @auth for bi-directional one-to-many @connection with AppSync GraphQL Transform?

て烟熏妆下的殇ゞ 提交于 2020-12-12 04:41:43
问题 I'm trying to figure out how can you protect at field level a one-to-many @connection with @auth against mutations that shouldn't be allowed. (ie: deny a specific user to run a mutation that will end-up inserting posts as another user.) Starting with the example for protecting a mutation at the field level: https://aws-amplify.github.io/docs/cli/graphql#field-level-authorization I tried doing something like this: type User @model @auth(rules: [{ allow: owner, ownerField: "id" }]) { id: ID!