[stork-users] Stork API Creating a Session

Slawek Figiel slawek at isc.org
Thu Dec 5 12:43:42 UTC 2024


Hello Shamir!

The Stork server requires providing three items to create a session:

- authenticationMethodId
- identifier
- secret

The meaning of the identifier and secret depends on the authentication 
method. The built-in authentication method is called "internal." It uses 
the credentials stored in the Stork database to authenticate users. In 
this case, the identifier is a user email or login, and the secret is a 
user password.

Below is a snippet of how you can create a session in Python:

```
     import requests

     session = requests.Session()
     credentials = {
         "authenticationMethodId": "internal",
         "identifier": "admin",
         "secret": "admin",
     }
     session.post("http://server:8080/api/sessions", json=credentials)
     return session
```

Regards,
Slawek Figiel

On 04/12/2024 21:51, Shamir Ramji wrote:
 > Hi,
 >
 > Hoping someone can help me out.  I'm trying to hit the api and create a
 > cookie by calling /sessions, but it requires a "identifer" and a
 > "secret".  Does anyone know where I can find that info?
 >
 > Thanks.
 >
 > --
 >
 >
 > /The contents of this message and any attachment(s) are confidential,
 > proprietary to the City of Edmonton, and are intended only for the
 > addressed recipient. If you have received this in error, please
 > disregard the contents, inform the sender of the misdirection, and
 > remove it from your system. The copying, dissemination, or distribution
 > of this message, if misdirected, is strictly prohibited./
 >


On 04/12/2024 21:51, Shamir Ramji wrote:
> Hi,
> 
> Hoping someone can help me out.  I'm trying to hit the api and create a 
> cookie by calling /sessions, but it requires a "identifer" and a 
> "secret".  Does anyone know where I can find that info?
> 
> Thanks.
> 
> -- 
> 
> 
> /The contents of this message and any attachment(s) are confidential, 
> proprietary to the City of Edmonton, and are intended only for the 
> addressed recipient. If you have received this in error, please 
> disregard the contents, inform the sender of the misdirection, and 
> remove it from your system. The copying, dissemination, or distribution 
> of this message, if misdirected, is strictly prohibited./
> 



More information about the Stork-users mailing list