🚀 New Feature: Scoped Organization Tokens

:key: Introducing Scoped Organization Tokens (SOT)

I’m excited to announce the public availability of Scoped Organization Tokens (SOT), a powerful new feature that redefines how you manage automation in your organization.

This release is a direct response to a critical challenge many of you have shared: relying on Personal Access Tokens (PATs) for automated processes like CI/CD pipelines. PATs, while useful, are tied to individual users, which creates significant security and management headaches.

:green_circle: How SOT Improves your workflow

SOT is designed to eliminate these pain points by offering a more secure, scalable, and manageable way to handle authentication.

  • SOT is not tied to a specific user, so your integrations won’t break when someone leaves your organization. This also allows you to apply the principle of least privilege by creating separate tokens for different automations, each with a specific scope.
  • With SOT, there’s no need to manually update tokens every time a team member’s role changes. This simplifies user lifecycle management and reduces operational overhead.
  • Organization admins have full control over all tokens, including the ability to set expiration dates and revoke them at any time.

This feature is now available to all organization admins on Team and Enterprise plans.

We hope SOT significantly reduces friction and enhances security compared to PATs. Please give it a try and share your feedback—your insights are crucial.

For more details on how to get started, please refer to our documentation.

Thank you,

Identity

10 Likes

Hi Nour,
the SOTs are bound to specific projects. As we understand it, whenever a new project is created, a new token needs to be created as well.

It would be great if the SOTs would follow the “Permission Template” approach, i.e. if it would be possible to specify a “Project Key Pattern”, so that newly added projects could make use of the existing SOT if the match the regexp.

Thanks!
Rubén

4 Likes

We’ve been waiting for SOT eagerly, however, in a current implementation, SOTs are useless to us, and we have to use dedicated service-user for that. The only reason for that is that SOTs are mandatory to be limited to specific projects.

We use shared token to analyze projects from GitLab pipelines (defined via global CI variable). If we’re to use SOT limited to specific projects, we’ll have to regenerate SOT every time a new project is created and then update it in our global CI variable. With service-user we do not need to do that.

SOTs which are project-limited are no better for us than having personal tokens generated for each project - the approach we did before, but switched to service-user instead to save efforts and simplify CI implementation for teams.

Once there’s an option to have an organization-wide SOT (i.e., without mandatory limit by projects), then we’ll switch to SOTs immediately. Our desire is to have a SOT which can analyze all projects, when projects are constantly being added or removed, and so that we do not need to regenerate SOT.

4 Likes

Hi,

we would like to get ability to set “All projects“, not to update token every time a new project has been created.

It is valid for “scan” permissions.

3 Likes

Trying to use the SOT for a connection in Azure Pipelines SonarCloudPrepare@3 task.

Clearly this is an integration problem and not a “bug” with the SonarCloud SOT feature as such. I wanted to put this here for others’ benefit and in case there is a known issue I’ve not found yet!

When configuring the Service Connection, there are errors around (presumably) searching for the name of the SonarCloud organisation. This makes sense since the SOT is scoped to scan a single project of course! However, it does imply that simply dropping in the SOT as a replacement for the PAT can’t work for Azure Pipelines yet. The Azure Service Connections simply won’t present you with a list of organisations, so it won’t “Verify” and even if you attempt to save without verification, doesn’t seem to work in the pipeline for the same reason.

Service Connection:

Task (being configured in the YAML pipeline editor):

(note an attempt here to force its hand by telling it the information it needed by typing the Organization in directly didn’t help)

Hello Dmitrii,

Thank you for your input! I’m sorry SOT isn’t currently meeting your needs, and I’ve noted your request for Org. wide tokens.

Creating tokens that never expire (which is possible), especially when organization-wide, is generally considered less secure. I’m curious: Do you foresee any security concerns or management challenges with using these kinds of tokens?

Also, would supporting this feature in combination with automatically rotating tokens meet your needs, or is that capability not mandatory?

If you or anyone else reading this has input, please let us know.

1 Like

We ran into the same issue. We have hundreds of projects in our organization and want to execute SonarQube cloud scans from our Jenkins pipelines.

Selecting this many projects results in an HTTP 500 error so we aren’t even able to create a SOT for all of the current projects, nor can we change the attributed projects at a later time. So yes, having an organization-wide token for projects (or at least a Select All option) would be preferable.

Also we have more projects that aren’t scanned by Sonar at this time - previously we checked the presence of a projects by doing a search first. This doesn’t seem to be supported by the SOT at this time, is that correct?

1 Like

Hi Sietzejan, ah, having non-expiring token is not what we need, sorry for the confusion. We’re OK setting “1 year” expiration, for example. My point about “never expire” was about “when we add new projects to Sonar, we do not want to regenerate SOT, we want to use the SOT which we’ve created before, and that it must automatically be able to scan all new projects (and old ones, of course)”.

1 Like

Thank you all for the feedback — we truly appreciate it, and please keep it coming!

We’re already planning improvements to address some of the friction points you’ve raised. As next steps, we’re aiming to tackle the following:

  • Support selecting all projects, all public projects, or all private projects
  • Enable additional permissions for the SOT, such as Browse and Administer Issues
  • Allow editing of tokens to update their scope and permissions

We’ll keep you posted as these enhancements roll out. Your input continues to shape the direction of this feature — thank you again!

2 Likes

Hello Nour, thanks for the answer and for the efforts!

I’d like to clarify this point:

Support selecting all projects

Just selecting all projects (even if we have ability to update SOT afterwards) is not enough. Our desire is to make sure that all new projects are automatically covered by SOT which we’ll create for “all projects”. If we’ll have to update SOT every time when we create new project (so that SOT covers newly created project as well) - this will do no good for us, and we’ll rather use service user, for which we do not need to do anything when new project gets created.

2 Likes

@dmitrii.lobanov That makes a lot of sense — thanks for the clarification!
I can confirm that Select All Projects includes both existing projects and any that are created in the future.

2 Likes

@notverygeordie Thank you for the feedback!
Scoped Organization Tokens only allow project scans for the moment, are you trying to use an SOT for another purpose? Happy to hear more about it.

Thank you for the clarification Dmitrii!

Super clear. We will work on solutions.

1 Like

If only! No. I am stuck in a situation that I suspect is not yet supported, but is blocking me from using the tokens for project scans.

I’m using Azure Pipelines. The integration steps are described in your documentation here:

In the overview there, there are 5 steps described. Step 3 is the project scan. I haven’t actually got to Step 1.

I am here:

That is the step in my original post - something about the SonarQube Cloud connection type simply won’t accept my SOT. That despite it being described in the documentation link there!

I have just created a fresh SOT and tried again - following the instructions explicitly. “Save and Verify” fails at the verify stage with this error:

Haha! I have obstinately hit “Save without verification”, edited the pipeline yaml without attempting to use the wizard and run the build regardless
 and it processed “SonarCloudPrepare” ok! Will update at the end of the run.

EDIT: it worked. So the workaround is to ignore all of the errors and hand-code the SonarCloudPrepare@3→inputs→ SonarCloud: ‘MySonarConnection’ property of your task.

Errors appear when Verifying the configured SonarCloud connection, and when attempting to choose and use the values for SonarCloud/organization/projectName/projectKey in your SonarCloudPrepare@3 pipeline task. However, if edited in spite of this, the task itself works.

FURTHER EDIT since new users are limited to three consecutive posts in a thread apparently!

“Just one more thing” (as short, trench-coated, cigar–toting detectives from the 70’s are wont to say):

It would be excellent to update the documentation to explain this briefly. A note to suggest (for example) that we either don’t verify and “code it blind” in the yaml; or set up a connection with a PAT to check it works, then switch to a SOT without verifying and re-test the pipeline. This would be simple enough to explain as there is no “Browse” permission (or whatever is tripping us up) support provided by SOTs as yet.

Is managing SOTs available through the Web API?

1 Like

A post was split to a new topic: Deleting projects that are bound to an SOT

Additionally, to select the maximum available expiration time that is not forever (which is a 1 year exactly), you have to pick the Custom option and enter the exact date at the moment. It would be much faster if “1 year” was a selectable option for expiry. Please consider that, thanks!

Moreover, when setting up CI-based analysis, SonarCloud still creates a Personal Access Token (PAT) for use with tools such as GitHub Actions. Ideally, we should have the option to create or reuse a Scoped Organization Token (SOT) instead. This approach only works well if the token is bound to all projects, without explicitly referencing their names.