# Discourse 中若无 SSO 信息，导入的用户将无法登录

**URL:** <https://meta.discourse.org/t/imported-user-unable-to-log-in-if-no-sso-details-in-discourse/111886>\
**Category:** WordPress\
**Tags:** sso, discourseconnect\
**Created:** [2019 年3 月 18 日 04:08 UTC](https://meta.discourse.org/t/imported-user-unable-to-log-in-if-no-sso-details-in-discourse/111886 "2019-03-18T04:08:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
发布日期： [2019 年3 月 18 日 16:28 UTC](https://meta.discourse.org/t/imported-user-unable-to-log-in-if-no-sso-details-in-discourse/111886/2 "2019-03-18T16:28:23Z")

</div>

> [@omarfilip](#):
>
> If a user who was imported and does not have an external ID in Discourse tries to log in to Discourse for the first time since importing he will get the _There is a problem with your account. Please contact the site’s administrator_ error message.

Discourse has changed the way it deals with users when the SSO parameter `require_activation` is set to `true`. When that parameter is set, Discourse will no longer match existing users to new users by their email address.

You are going to have to manually create an SSO record for this user through the rails console. Based off the values in your logs, you can create the record like this:

First, get the user’s Discourse `id`:

```plaintext
User.find_by_email('example.user5656@gmail.invalid').id

```

Substitiute that id for `<user-id>` in the command below. The `last_payload` is intentionally set to an empty string:

```plaintext
SingleSignOnRecord.create(user_id: <user-id> , external_id: 1002 , external_email: 'example.user5656@gmail.invalid', last_payload: '')

```

The user should now be able to login.

---

_[View the full topic](https://meta.discourse.org/t/imported-user-unable-to-log-in-if-no-sso-details-in-discourse/111886)._
