Intro to Elixir (Adding Authentication to a GraphQL API)

in #utopian-io6 years ago (edited)

What Will I Learn?

  • You will learn how to implement a context plug in Phoenix
  • You will learn how to add authentication to a GraphQL Node in Phoenix 1.3
  • You will learn how to use a virtual session variable to promote authentication through GraphQL

Requirements

  • A basic knowledge of Elixir
  • A basic understanding of the Phoenix Framework (at least 1.2).
  • Knowledge of how APIs work in general
  • The codebase from Parts A and B.

Difficulty

  • Intermediate

Description

In this tutorial, we finish our Phoenix GraphQL endpoint by implementing Authentication by way of Guardian and Json Web Tokens (JWT). We use a context plug to verify that each request has a JWT attached to it before we issue a response with the appropriate information to the user. We also take advantage of the GraphQL type system to create a virtual type that allows us to symbolically link the user's session to the actual data-layer of the application.

Full Github Source Code is here

Video Tutorial

Curriculum



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

All the rules changes are announced by the Utopian account.

You can contact us on Discord.
[utopian-moderator]

Thank you for your consideration on this matter.

Your contribution cannot be approved. See the Utopian Rules.

Your contribution has to follow the formatting provided to you via the editor, as well as being formal and informative. It also shouldn't include anything unrelated to the project or the contribution process.

  • Your post's formatting doesn't follow the Video Tutorial category template provided to you by Utopian. You can find it in the Utopian editor while submitting a contribution. Please try to extend your presentation as in step by step with more details.

Please, make sure you read the rules carefully before you contribute again, as all contribution rejections are now indisputable and we don't allow users to correct their mistakes.

You can contact us on Discord.
[utopian-moderator]

Sorry, I didn't see the formatting when I made the post last night. How am I supposed to know that the rules have changed If I can not see the changes? I've posted a contribution almost every single day for the past two weeks (with no problems); how am I supposed to know that the rules have changed if everything looks exactly as it has for those past 14-15 contributions?

Haven't made it through the entire video but sounds very professional so far.

I try to keep things as professional as possible when making my videos. Though in the past I did try to add humor to my videos since the material can be dry, it just never worked out.

Hey @tensor I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.032
BTC 61041.41
ETH 2947.17
USDT 1.00
SBD 3.85