<Login /> and <Auth />

Today, we will combine Authentication (valid user is logged in) and Authorization (what permissions does the user have) to create a UI that ensures that users only have access to content and functionality that they’re granted access to.

Learning Objectives

Students will be able to

Describe and Define

Execute

Today’s Outline

Notes

Implementing RBAC with Conditional Rendering

What problems do we need to solve for?

Proposal

Authorization Context

<Login/> component

<Auth /> component

// The div only shows if you are logged in
  <Auth>
    <div />
  </Auth>

// The div only shows if you are logged in AND have read permissions
  <Auth capability="read">
    <div />
  </Auth>