Skip to content

Instantly share code, notes, and snippets.

View jessezach's full-sized avatar

Jesse Zacharias jessezach

  • Engineering @ GoCardless
  • United Kingdom
View GitHub Profile
@jesster2k10
jesster2k10 / README.md
Last active May 6, 2024 18:16
Rails API Social Login

Rails API-Only Social Login

This is another piece of code I've extrapolated from a Ruby on Rails project I'm currently working on. The code implmenets social login with a RoR API-based application, targeted at API clients.

The setup does not involve any browser-redirects or sessions as you would have to use working with Omniauth. Instead, what it does is takes an access_token generated on client-side SDKs, retireves user info from the access token and creates a new user and Identity in the database.

This setup works with native applications as described in the Google iOS Sign In Docs (see Authenticating with a backend server)

@agconti
agconti / example_locustfile.py
Last active May 5, 2022 00:49
Example Locustfile Keywords: Locustfile.py. Locust, LocistIo.
from locust import HttpLocust, TaskSet, task
class MostBasicLoadTest(TaskSet):
def on_start(self):
""" on_start is called when a Locust start before any task is scheduled """
self.login()
def login(self):
self.client.post("/api/api-token-auth/",
{