# Social Sign Up and Sign In (nextjs auth0)

**URL:** <https://community.auth0.com/t/social-sign-up-and-sign-in-nextjs-auth0/68146>\
**Category:** Get Help\
**Tags:** jwt, api, access-token, login, auth0\
**Created:** [August 18, 2021, 2:52pm UTC](https://community.auth0.com/t/social-sign-up-and-sign-in-nextjs-auth0/68146 "2021-08-18T14:52:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alkassimk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alkassimk/32/31207_2.png) [@alkassimk](https://community.auth0.com/u/alkassimk)\
**Post date:** [August 18, 2021, 2:52pm UTC](https://community.auth0.com/t/social-sign-up-and-sign-in-nextjs-auth0/68146/1 "2021-08-18T14:52:19Z")

</div>

I’m attempting to implement a social sign-in and sign up with nextjs auth0. I’d previously implemented it, where when a user would login it would redirect them to the auth0 sign up / sign-in form with my domain and they could use social sign-in / sign-ups, from there.

Since then though, I’ve moved onto an implementation with a custom sign-up form, with different social providers as buttons under the sign-up form. Now I’d like for users to be able to click on the social provider and then be redirected to the corresponding provider sign-in / sign-up page, as opposed to going to the auth0 sign-up form with my domain.

So yeah I’ve been trying to find documentation on how to carry this out, haven’t found something that seems to do what I’m trying to achieve yet though, if anyone could help point in the right direction that would be great!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 18, 2021, 10:02pm UTC](https://community.auth0.com/t/social-sign-up-and-sign-in-nextjs-auth0/68146/3 "2021-08-18T22:02:03Z")

</div>

Hi @alkassimk,

Welcome to the Auth0 Community!

If you pass a `connection` param to your authorize request, you can redirect your user’s to the IdP login page.

Here is the doc for it. Let me know if that solves the issue:

[https://auth0.com/docs/api/authentication#social](https://auth0.com/docs/api/authentication#social)

---

<div class="post-metadata">

**Author:** ![alkassimk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alkassimk/32/31207_2.png) [@alkassimk](https://community.auth0.com/u/alkassimk)\
**Post date:** [August 19, 2021, 1:06pm UTC](https://community.auth0.com/t/social-sign-up-and-sign-in-nextjs-auth0/68146/4 "2021-08-19T13:06:34Z")

</div>

Thanks for the response Dan,

I just tried that, currently getting a CORs error, even though after I got the error the first time I added localhost to the ‘Allowed CORS’ on the app in the dashboard.

Here’s the error, also is it normal for the URL to appear like this in the console when throwing the error? (I’ve changed the domain name and the client\_id).

Access to XMLHttpRequest at ‘[https://DOMAINNAME.com/authorize?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20response\_type=token&%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20client\_id={CLIENTID}&%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20connection=facebook&%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20redirect\_uri=http://localhost:3000/api/auth/callback&%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20state=STATE](https://DOMAINNAME.com/authorize?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20response_type=token&%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20client_id=%7BCLIENTID%7D&%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20connection=facebook&%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20redirect_uri=http://localhost:3000/api/auth/callback&%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20state=STATE)’ from origin ‘[http://localhost:3000](http://localhost:3000)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

---

<div class="post-metadata">

**Author:** ![alkassimk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alkassimk/32/31207_2.png) [@alkassimk](https://community.auth0.com/u/alkassimk)\
**Post date:** [August 20, 2021, 6:47am UTC](https://community.auth0.com/t/social-sign-up-and-sign-in-nextjs-auth0/68146/5 "2021-08-20T06:47:42Z")

</div>

Following up on this I found the solution to this, however now when I click on a button and it does the request, I can get the redirect url from axios’ response, however when I actually go the url, my `redirect_uri` is set to local host, however, when I complete the social login I keep being redirected to `mydomain.us.auth0.com/login/callback...`, not sure exactly wjy

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 20, 2021, 4:01pm UTC](https://community.auth0.com/t/social-sign-up-and-sign-in-nextjs-auth0/68146/6 "2021-08-20T16:01:38Z")

</div>

Can you please create a [HAR](https://auth0.com/docs/troubleshoot/guides/generate-har-files) and send it to me in a DM?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 13, 2021, 6:40pm UTC](https://community.auth0.com/t/social-sign-up-and-sign-in-nextjs-auth0/68146/7 "2021-10-13T18:40:29Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
