# How can I update trust level via SSO site

**URL:** https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876
**Category:** SSO
**Tags:** trust-levels, rest-api
**Created:** [1월 11, 2015, 4:01오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876 "2015-01-11T04:01:19Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![ihwan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ihwan/32/115432_2.png) [@ihwan](https://meta.discourse.org/u/ihwan)
#### Post date: [1월 11, 2015, 4:01오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/1 "2015-01-11T04:01:19Z")

</div>

Hi guys,

I’d like to update trust level via SSO site. I have a website there is basic free user and premium user. I just update the trust level from my site. Is there any good practice?

I’d like to check API documents but I couldn’t find it.

Thanks!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 11, 2015, 5:44오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/2 "2015-01-11T05:44:50Z")

</div>

If you trust your SSO users (say they are paid subscribers in some way) and the only way to log in is through SSO then sure, TL can default to TL1 no problem. That is a best practice.

---

<div class="post-metadata">

### Author: ![ihwan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ihwan/32/115432_2.png) [@ihwan](https://meta.discourse.org/u/ihwan)
#### Post date: [1월 11, 2015, 6:52오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/3 "2015-01-11T06:52:34Z")

</div>

I’m sending this data when it requests my site. It works well. What’s the param name for level data?

```
params = {
        'email': request.user.email,
        'external_id': request.user.id,
        'username': request.user.username,
    }

```

I’m using hosting service. It is hard to see the whole structure. Is there any manual? I couldn’t find it.

Thanks!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 12, 2015, 1:10오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/4 "2015-01-12T01:10:37Z")

</div>

Go to admin, site settings and search for default trust level, change from 0 to 1.

---

<div class="post-metadata">

### Author: ![ihwan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ihwan/32/115432_2.png) [@ihwan](https://meta.discourse.org/u/ihwan)
#### Post date: [1월 12, 2015, 6:49오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/5 "2015-01-12T06:49:05Z")

</div>

Is there any to update via API or SSO function? I have about thousand of premium users… I can not do that manually.

---

<div class="post-metadata">

### Author: ![ihwan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ihwan/32/115432_2.png) [@ihwan](https://meta.discourse.org/u/ihwan)
#### Post date: [1월 13, 2015, 11:36오후 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/6 "2015-01-13T23:36:17Z")

</div>

I just try like this but it doesn’t work.

```
params = {
        'email': request.user.email,
        'external_id': request.user.id,
        'username': request.user.username,
        'trust_level': 3
    }

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 14, 2015, 2:26오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/7 "2015-01-14T02:26:09Z")

</div>

@techapj will update the API howto topic with sample code for setting user trust level and granting a badge.

---

<div class="post-metadata">

### Author: ![ihwan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ihwan/32/115432_2.png) [@ihwan](https://meta.discourse.org/u/ihwan)
#### Post date: [1월 14, 2015, 4:28오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/8 "2015-01-14T04:28:46Z")

</div>

Thanks @codinghorror

@techAPJ I hope to integrate it via SSO, webhook or pull by discourse. I have to make a scheduler script if it is not…

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [1월 14, 2015, 12:42오후 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/9 "2015-01-14T12:42:49Z")

</div>

Updated the API howto topic:

> [@Discourse REST API Documentation](https://meta.discourse.org/t/discourse-api-documentation/22706):
>
> Discourse API Please view the Discourse API Documentation site for detailed info: [https://docs.discourse.org](https://docs.discourse.org)information_source Authentication API requests must use HTTP header based authentication. Pass your Api-Key and Api-Username as HTTP headers. Authentication via query parameters or request body is not supported (this was removed in April 2020). Please see the example cURL request below. The only API endpoints that continue to support credentials in query parameters are requests to…

Search for _Update trust level_ and _Grant a badge to user_ in the topic.

Also updated the [`discourse_api`](https://github.com/discourse/discourse_api) gem source code to provide endpoints for [updating user trust level](https://github.com/discourse/discourse_api/pull/65) and [granting a badge](https://github.com/discourse/discourse_api/pull/66).

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [1월 14, 2015, 1:11오후 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/10 "2015-01-14T13:11:43Z")

</div>

I also updated the [api Documentation](https://meta.discourse.org/t/discourse-api-documentation/22706) so that you know how to get the id’s of the badges you are granting 🙂

---

<div class="post-metadata">

### Author: ![ihwan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ihwan/32/115432_2.png) [@ihwan](https://meta.discourse.org/u/ihwan)
#### Post date: [1월 14, 2015, 7:19오후 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/11 "2015-01-14T19:19:07Z")

</div>

Thanks @blake @techAPJ

Do you guys know any solution to grant level or badge when it check SSO? or any web hook solution? I have to check our user type.

Thanks!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [1월 27, 2015, 3:48오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/12 "2015-01-27T03:48:18Z")

</div>

I recently added an extension to SSO to allow you to specify mods and admins, would be happy for a protocol extension that allows you to pass in a trust level if you want to try a PR. Would have to be extremely well tested.

---

<div class="post-metadata">

### Author: ![leog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leog/32/119839_2.png) [@leog](https://meta.discourse.org/u/leog)
#### Post date: [3월 29, 2018, 9:38오후 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/13 "2018-03-29T21:38:17Z")

</div>

Hi all. Sorry to wake this conversation up after so long.

I was wondering if this can be done now by passing a parameter through the SSO payload.

I need to be able to set the user trust level depending on a flag I have available in the database where the SSO payload gets constructed. I think this should be something that should be available as trust level is a very important feature which defines the user’s experience as much as any of the information already in the payload. In my case, depending on the trust level we want to enable the user to fully take part of the community or not unless they validate their account and we mark that flag as true or not.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Cardinalflyer](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Cardinalflyer](https://meta.discourse.org/u/Cardinalflyer)
#### Post date: [2월 20, 2019, 3:08오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/14 "2019-02-20T03:08:29Z")

</div>

Old thread, but the functionality mentioned in this thread (passing a trust level via SSO) would be very helpful. Was it ever implemented?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2월 20, 2019, 3:14오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/15 "2019-02-20T03:14:50Z")

</div>

Technically yes, but it is a bit tricky.

You would create a hidden group and grant that group trust level, then you would add that group to the user.

A bit convoluted, but on the upside you do get way better auditing.

---

<div class="post-metadata">

### Author: ![Cardinalflyer](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Cardinalflyer](https://meta.discourse.org/u/Cardinalflyer)
#### Post date: [2월 20, 2019, 3:20오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/16 "2019-02-20T03:20:16Z")

</div>

Got it… I’m trying to create classes of users: members, past members etc. to control access. I have that data in my SSO responder and that sounds like it could work!

I’ve been searching… is there a users guide or description of a) how to assign groups in SSO and b) controlling access by groups? I saw the trust level access control… likely I can track that down with more research.

I appreciate your time, gives me hope for what I need to do to move over a group that has existed for over 20 years.

---

<div class="post-metadata">

### Author: ![Cardinalflyer](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Cardinalflyer](https://meta.discourse.org/u/Cardinalflyer)
#### Post date: [2월 20, 2019, 3:24오전 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/17 "2019-02-20T03:24:20Z")

</div>

I think I found it… will run with these clues! thanks.

---

<div class="post-metadata">

### Author: ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)
#### Post date: [4월 15, 2020, 3:22오후 UTC](https://meta.discourse.org/t/how-can-i-update-trust-level-via-sso-site/23876/18 "2020-04-15T15:22:38Z")

</div>

좋은 소식은, 몇 가지 간단한 API 호출만으로 신뢰 수준(Trust Level)을 업데이트할 수 있었고, 잘 작동했다는 것입니다.

나쁜 소식은, 사용자를 TL2로 올려서(다른 사용자를 무시할 수 있도록 하기 위해) 그 사용자에게 배지가 부여되도록 하면, 알림이 생성되고 "몇 주간 회원으로 계신 것을 감사드립니다."라는 문구가 포함된 배치 관련 정보가 표시된다는 점입니다. 특히 기존 회원 중 상당수가 아직 TL(신뢰 수준)에 대해 익숙해지지 않은 상태(완전히 새로운 포럼 소프트웨어!)이기 때문에 상황이 더 좋지 않습니다.

더 나쁜 소식은, 제가 사이트를 많이 사용하고 있다고 판단한 discobot이 고급 튜토리얼에 초대한다는 이메일을 4개나 받았다는 것입니다. 아마도 이것이 트리거가 된 것 같습니다. 왜 4개나 왔는지는 잘 모르겠습니다… API를 호출할 때마다 하나씩 온 건가요? 제 커뮤니티 회원들은 기술에 밝지 않고, 새로운 소프트웨어로 이관한 것에 이미 매우 불만이 많은 상태입니다. 이런 일은 분명히 좋아하지 않을 것입니다. 그래서 이 문제를 해결해야 합니다.

다른 분들을 위한 참고 사항입니다. 이제 TL2 배지와 고급 discobot 메시지를 비활성화하는 방법을 알아내러 가보겠습니다.
