Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthGuardian support for adding ApolloServer roles directly #43

Open
sgrove opened this issue Jan 21, 2020 · 0 comments
Open

AuthGuardian support for adding ApolloServer roles directly #43

sgrove opened this issue Jan 21, 2020 · 0 comments

Comments

@sgrove
Copy link

sgrove commented Jan 21, 2020

We've added an effect specifically for our onegraph-apollo-server-auth library
today, where you can add a role directly in AuthGuardian. It was possible
before, but only with the In the json add to the list at path effect, which
was less explicit.

Now for example if you want to only allow someone to have moderator access to
your Apollo Server GraphQL server if they're a member of your GitHub
organization, you can write the following rules:

When this user on GitHub is member of organization named "OneGraph"

Then On apollo server add roles [moderator]

And our JWT will generated appropriately:

{
  "iss": "OneGraph",
  "aud": "https://serve.onegraph.com/dashboard/app/00000000-0000-0000-0000-000000000000",
  "iat": 1579589770,
  "exp": 1579676170,
  "user": {
    "roles": [
      "moderator"
    ]
  }
}

See the OneGraph Apollo Server Auth
Example
for
more info on how to use AuthGuardian to secure your Apollo Server GraphQL
server!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant