ashkan117

ashkan117

I am trying to migrate my current application from only allowing users to sign in with Google Auth, to also be able to create an account with username and password. I want people with just username and password to be able to optionally connect their google accounts in order to sync their calendars.

So I currently have a working setup for register_with_password and register_with_google but I’m a little unsure how I can add the option just to connect a users Google Calendar? Would I need to create another oauth strategy?

      # Current oauth2 for registering
      oauth2 :google do
        ...
        authorization_params(
          access_type: "offline",
          scope:
            "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/calendar"
        )

        identity_resource(MyApp.Accounts.UserIdentity)
      end

  1. Do I need another oauth2 strategy that only needs the google calendar scope?
  2. How do I connect this to my Phoenix/Liveview app

Showing Posts 1 to 2

kamaroly

kamaroly

  1. I don’t think you need another strategy for google calendar. Google uses centralised authentication for all its products.
  2. After the authentication is successfully, you should be able to access the logged in user via @current_user assign in liveview.
ashkan117

ashkan117 OP

Hello! Thanks for the reply.

Maybe I could explain my problem better. In my case, I show the user a calendar. I’d want that calendar linked to multiple google calendar accounts. So in this case I’d want one user to have many google accounts connected.

Another thing that makes me think I need multiple strategies is that I’d want each account to be flexible and allow for different read/write permissions.

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
csmr
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley: Mutonex gamedesign was finish...
New
Stef-Verniers
Hello I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
kip
In 2021 I started a new library called Tempo with the objective of modelling time as a set of intervals - not as instants. In 2022 I gave...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews