⚠️ This lesson is retired and might contain outdated information.

Configure Authorization on AWS Amplify

Ali Spittel
InstructorAli Spittel
Share this video with your friends

Social Share Links

Send Tweet
Published 3 years ago
Updated 2 weeks ago

Now that we have our sample data, we need to create authorization rules for our different users. We are going to create rules for our unsigned-in users, our signed-in users, and for our Admins.

Instructor: [0:01] Now, we'll add authentication. Click on the Enable Authentication button. You can configure your authentication to have different login mechanisms and multi-factor authentication. You can also add different attributes to collect on sign-up and change your password protection settings. I'm just going to deploy the default configuration.

[0:20] Once authentication is deployed, we'll add in authorization rules. Go back to Home and then view your data model. You can add authorization rules to each model. First, click on the Blog model. On the right-hand panel, configure Authorization Rules. Select the dropdown for anyone authenticated with the API can create, read, update, and delete Blog.

[0:41] We don't want signed-out members to be able to perform all these actions. We'll uncheck Create, Update, and Delete. That will make it so that un-signed-in users can read blogs, but they can't modify them.

[0:54] Then, click the Add Authorization Rule dropdown. We will allow admin users to perform all actions on a blog. Under Specific Group, select Create New. We'll title our group Admin. Create your group, then select the Admin group. The Admin group will be able to perform all actions on a blog.

[1:17] Switch over to the post model. We don't want anybody to be able to modify a post. Uncheck Create, Update, and Delete.

[1:25] We'll allow signed-in users to be able to create posts. Select any signed-in users and then unselect Update and Delete. Then, we want the owner of a post, so the person who made it, to be able to update and delete that post that they created. We'll toggle on Enable Owner Authorization. Select Update and Delete. We'll save and deploy.

[1:54] We've successfully enabled and deployed authentication for our application and edit authorization rules to our data models.

egghead
egghead
~ 6 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today