Add “Sign in with Github” in one click to authorize your Github OAuth App and access Github REST API using Cotter and Next.js.
Cotter just launched a Github Login integration 🎉. This means you can easily log your users in and get an access token to enable Github integrations in your app.
We’re going to build a website with Next.js that allows your users to login with email or with Github accounts and get a list of their public and private repositories.
We learned how OAuth 2.0 works in general in What on Earth is OAuth? and learned how to securely store access tokens in the front end. In this post, we’ll learn which OAuth 2.0 flow you should use based on what you’re building.
In general, the OAuth 2.0 flow looks like this diagram below (if you’re not familiar with the OAuth 2.0 Flow below, check our explanation here).
We went over how OAuth 2.0 works in the last post which covered how to generate access tokens and refresh tokens. What’s next is how do you store them securely in your front-end?
Access tokens are usually short-lived JWT Tokens, signed by your server, and is included in every HTTP request to your server to authorize the request.
Refresh tokens are usually long-lived opaque strings stored in your database, used to get a new access token when it expires.
There are 2 common ways to store your tokens: in
localStorage or cookies. …
Get a quick intro on what OAuth 2.0 is and how signing in with OAuth 2.0 works — explained in simple terms using Google Sign In as an example.
We’re excited to tell you that Cotter now generates access tokens and refresh tokens on authentication. Let’s first go over the concepts of OAuth 2.0 and the tokens before we jump in on how to use it.
OAuth 2.0 is an authorization framework that defines how a third-party application can obtain access to a service securely without requiring security details (username, password, etc.) from the user. A common example of OAuth 2.0 is when you use “Sign in with Google” to log in to other websites. …
When building an app, it’s often a requirement to make sure your users are real and you want to know if they own the email or phone number that they signed up with so you can communicate via those channels.
In this tutorial, we’ll build a flutter app that allows users to sign up and sign in with their email or phone number.
If this is your first time making a Flutter app, check out their installation guide. …
If you’re building an app, starting with the increasingly popular passwordless login is the way forward — it’s secure, easy, and frictionless for the user.
In this tutorial, we’ll create a Flutter app from scratch that allows users to sign in with their device.
When a user first signs up, we’ll automatically trust the current device. This means that the user can automatically log in when accessing your app from this device. When the user wants to access the app from another device, the user can simply tap a prompt in your app to approve the login request.
If this is your first time making a Flutter app, check out their installation guide. To create a new flutter app…
How do you log your users in and how do you give them access? We’ll go over how to authenticate and authorize users without passwords in Next.js.
When you start adding users to your website, the main question that you need to answer is: how do you log your users in and how do you give them access to the appropriate resources?
In this tutorial we’ll go over how to address both questions and build a Next.js app that only allows logged-in users to access private resources within the app.
Let’s go over some concepts: authentication vs authorization. …
In this tutorial, we’ll create a new Angular website and add a simple email and phone number verification. To verify the user’s phone number, we’ll give the options to send the code via SMS or WhatsApp.
If you want to make a new Angular app locally, first install the cli
then create a new Angular app:
Let’s start by verifying the user’s email before we jump to sending SMS or WhatsApp messages.
Cotter is already added to the CodeSandbox above. …
We’ll go over how to build a React Native app and allow users to “Sign in with device”.
We’ll build a simple React Native app that allows your users to Sign In with Device. To follow along with this tutorial, you’ll need to install Xcode or Android Studio.
We’ll name our app the Penguin App. To create a new app:
Run the app with
react-native run-ios or
react-native run-android .
Let’s add an email input field, a Register button, and a Sign In button. Copy the code below into your