# How to Pass Credentials in Code Instead of Config?

**URL:** <https://developer.sailpoint.com/discuss/t/how-to-pass-credentials-in-code-instead-of-config/195370>\
**Category:** SHF Discussion and Questions\
**Tags:** apis, sailpoint-identity-security\
**Created:** [February 8, 2026, 11:13pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pass-credentials-in-code-instead-of-config/195370 "2026-02-08T23:13:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_ch77](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@rahul\_ch77](https://developer.sailpoint.com/discuss/u/rahul_ch77)\
**Post date:** [February 8, 2026, 11:13pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pass-credentials-in-code-instead-of-config/195370/1 "2026-02-08T23:13:17Z")

</div>

Hi team,

I’m using the SailPoint Python SDK for automation and need to pass credentials directly in code instead of using config file. The documentation doesn’t explicitly cover this scenario, below i’ve tried

from sailpoint.configuration import Configuration

configuration = Configuration(  
base\_url=“https:// [tenant.api.identitynow.com](http://tenant.api.identitynow.com)”,  
client\_id=“xyz”,  
client\_secret=“xyz”  
)

configuration = Configuration()  
configuration.base\_url = “[https://tenant.api.identitynow.com](https://tenant.api.identitynow.com)”  
configuration.client\_id = “xyz”  
configuration.client\_secret = “xyz”

Has anyone done this? What’s the correct approach?

thank you

---

<div class="post-metadata">

**Author:** ![kalyan\_dev32](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/kalyan_dev32/32/21870_2.png) [@kalyan\_dev32](https://developer.sailpoint.com/discuss/u/kalyan_dev32)\
**Post date:** [February 8, 2026, 11:24pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pass-credentials-in-code-instead-of-config/195370/2 "2026-02-08T23:24:32Z")

</div>

Hello @rahul_ch77,

Have you tried using ConfigurationParams?

```auto
from sailpoint.configuration import Configuration, ConfigurationParams

configParams = ConfigurationParams()
configParams.base_url = "https://xx.api.identitynow-demo.com"
configParams.client_id = "xxxx"
configParams.client_secret = "xxxx"

configuration = Configuration(configurationParams=configParams)

```

hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [April 9, 2026, 11:25pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pass-credentials-in-code-instead-of-config/195370/3 "2026-04-09T23:25:19Z")

</div>

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