I am trying to integrate Social Sign-In using Ory ...
# ory-network
c
I am trying to integrate Social Sign-In using Ory Network w/ the Golang SDK and a custom UI (not using the Account Experience). I have been able to implement Registration, Login, Logout w/ the password method largely thanks to the very helpful documentation on integration w/ custom UI, but I have not seen the same kind of instructions for Social Sign-In aside from the OAuth+OIDC authorization code flow docs and would be great to update or adapt those w/ similar examples to flesh out how to integrate JS/TS & Golang SDKs w/ a custom UI. I am currently I am able to: • Create and update a registration flow for
oidc
method (w/ configured Google OAuth client details in the Ory Console) ◦ Using
client.UpdateRegistrationFlowWithOidcMethod
and
FrontendApi.UpdateRegistrationFlow
• Trigger my backend to redirect the browser to Google consent screen • After consent screen, receive and parse the Google callback on the backend, which includes: ◦
ory_kratos_continuity cookie
state
code
scope
prompt
authuser
hd
So at this last step I am unsure which parts of the
ory/client-go
SDK & Frontend API I should be using to complete the process, I think I am at 3 & 4 (as described in the authorization code flow docs mentioned previously). If there are any examples anywhere on how to perform this process pointing me to them would very much be appreciated.
For anyone reading this in the future, at the time of writing, Ory does not handle the token verification and exchange w/ the identity providers up front if you are using the SDK (in my case, I used the coreos/go-oidc library to handle this part) unless you are using the Account Experience UI. With the Ory Client SDK, you would have to use the Frontend API to interface w/ the
Update Registration Flow
after your oidc client has verified and exchanged tokens with your identity provider, you can update the registration flow with: • method (
oidc
) • provider string • id token (not marked as required but it is in order to complete the flow) • csrf token • traits with the retrieved claims The above worked w/ Google Social Sign In for me.