# Unable to Test Discourse Connect on localhost

**URL:** <https://meta.discourse.org/t/unable-to-test-discourse-connect-on-localhost/202986>\
**Category:** SSO\
**Created:** [September 8, 2021, 4:04pm UTC](https://meta.discourse.org/t/unable-to-test-discourse-connect-on-localhost/202986 "2021-09-08T16:04:50Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Sky020](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sky020/32/189842_2.png) [@Sky020](https://meta.discourse.org/u/Sky020)\
**Post date:** [September 8, 2021, 4:04pm UTC](https://meta.discourse.org/t/unable-to-test-discourse-connect-on-localhost/202986/1 "2021-09-08T16:04:50Z")

</div>

Hello all,

We are wanting to integrate Discourse badges with our platform. That is, allow a user to connect their Discourse account to their account on our platform.

To link the accounts, we thought [Discourse Connect](https://meta.discourse.org/t/13045?silent=true) would be the way to go. However, we have come into CORS errors with the redirection:

```console
Access to fetch at 'https://forum.freecodecamp.org/session/sso_provider?sso=<hash>'
(redirected from 'http://localhost:3000/discourse/connect') from origin
'http://localhost:8000' 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.
If an opaque response serves your needs, set the request's mode to 'no-cors'
to fetch the resource with CORS disabled.

```

I have tried a whole bunch of settings for [Discourse Connect](https://meta.discourse.org/t/13045?silent=true), including adding server, client, and Discourse addresses to `discourse connect provider secrets`, but to no avail.

**To clarify** : We do not want to use [Discourse Connect](https://meta.discourse.org/t/13045?silent=true) to log in to anything.

**Locations**

- `freecodecamp.org` - platform domain
- `forum.freecodecamp.org` - Discourse instance subdomain
- `localhost:3000` and `localhost:8000` - server and client of `freecodecamp.org` development environment

**Relevant code:**  
[https://github.com/freeCodeCamp/freeCodeCamp/pull/43168/files#diff-c99b1f4c50468e6835c7456cff5841cdd1cbe76ca7a2ac1d15893f839ff37799R278](https://github.com/freeCodeCamp/freeCodeCamp/pull/43168/files#diff-c99b1f4c50468e6835c7456cff5841cdd1cbe76ca7a2ac1d15893f839ff37799R278)

```javascript
return res.redirect(
    `${FORUM_LOCATION}/session/sso_provider?sso=${URL_ENCODED_PAYLOAD}&sig=${HEX_SIGNATURE}`
  );

```

Any assistance would be much appreciated.

---

_[View the full topic](https://meta.discourse.org/t/unable-to-test-discourse-connect-on-localhost/202986)._
