# Token based Api log in for cumulocity API in Version 10.18

**URL:** <https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [November 1, 2023, 9:19am UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365 "2023-11-01T09:19:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias.Burkert](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@Matthias.Burkert](https://community.cumulocity.com/u/Matthias.Burkert)\
**Post date:** [November 1, 2023, 9:19am UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365/1 "2023-11-01T09:19:57Z")

</div>

#### \ ***Cumulosity hosted we service with version 1018.0.229** used \*

#### \*Detailed explanation of the problem: Currently i am doing a proof of concept to evaluate the token based use of the cumulosity api (no base auth any longer). this does not seem to work. I was searching for a detailed documentation to tackle this topic but was not succesful with finding anything. \*

#### \*Error messages / **full error** message screenshot / **log** file:

“message”: “Full authentication is required to access this resource”,  
“error”: “security/Unauthorized”,  
“info”: “ttps://www.cumulosity.com/guides/reference/rest-implementation//#a-name-error-reporting-a-error-reporting”  
\*

#### _Question related to a **free trial** , or to a **production (customer)** instance?_

Customer instance is used: Startseite / Cumulocity - Cockpit

---

<div class="post-metadata">

**Author:** ![Felix.Schaede](https://avatars.discourse-cdn.com/v4/letter/f/c4cdca/32.png) [@Felix.Schaede](https://community.cumulocity.com/u/Felix.Schaede)\
**Post date:** [November 1, 2023, 10:32am UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365/2 "2023-11-01T10:32:30Z")

</div>

Hi Matthias,

have you checked the following part of the documentation that was added with 10.18: [Administration - Cumulocity IoT Guides](https://cumulocity.com/guides/10.18.0/users-guide/administration/#configuring-authentication-with-oauth2-access-tokens-from-authorization-servers).

Maybe that help?

We should also tag the question as Cumulocity IoT related, so it will appear in the Cumulocity section of the tech forum. @Stefan_Witschel.

Best regards

Felix

---

<div class="post-metadata">

**Author:** ![Korbinian\_Butz](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/korbinian_butz/32/10473_2.png) [@Korbinian\_Butz](https://community.cumulocity.com/u/Korbinian_Butz)\
**Post date:** [November 1, 2023, 2:40pm UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365/3 "2023-11-01T14:40:22Z")

</div>

Hi,

how does your API Call look like? Is this about the platforms OAI Authentication method - or the new 10.18 functionality to use an access token from a connected authorization server?

If you have your Token and you’re using the Authorization header, make sure your header is in the format: `Authorization: Bearer <your token here>` . The "Bearer " prefix is important, I’ve seen this error-message before when not stating it.

---

<div class="post-metadata">

**Author:** ![Matthias.Burkert](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@Matthias.Burkert](https://community.cumulocity.com/u/Matthias.Burkert)\
**Post date:** [November 6, 2023, 8:22am UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365/4 "2023-11-06T08:22:26Z")

</div>

Hello Korbinian,

i try t use the new 10.18 Functionality. So what i try is to use the api without the basic auth. The SSO is allready activated and running at our environment.

Even with the changed format it is not working. Shoudnt it work even simply im the browser if the browser contains the auth token as cockie ?

Thanks and best regards

Matthias

---

<div class="post-metadata">

**Author:** ![Korbinian\_Butz](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/korbinian_butz/32/10473_2.png) [@Korbinian\_Butz](https://community.cumulocity.com/u/Korbinian_Butz)\
**Post date:** [November 6, 2023, 3:57pm UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365/5 "2023-11-06T15:57:50Z")

</div>

Hi,

I’ve connected a Keycloak Server to a 10.18.0.229 Tenant and it worked for me - I was able to login and also to use keycloaks access tokens for Cumulocity API Calls. That indicates it’s not a general problem, probably more a misconfiguration somewhere.

How is the situation in your tenant? Which authorization server did you connect (Azure AD, Auth0, Keycloak, Okta, something different)? Does the SSO login work via UI? Does the login work via UI and it’s “only” the newly introduced functionality - to do API requests with the access token of your authorization server - that doesn’t work for you?

Some links that might help:

- Configure SSO for Azure AD: [Administration - Cumulocity IoT Guides](https://cumulocity.com/guides/users-guide/administration/#integration-with-azure-ad)
- An example for Auth0: [Using Auth0 as Single-Sign-On for Cumulocity IoT](https://community.cumulocity.com/t/using-auth0-as-single-sign-on-for-cumulocity-iot/4033)
- An example for Okta: [Cumulocity IoT SSO Integration with Okta](https://community.cumulocity.com/t/cumulocity-iot-sso-integration-with-okta/4170)
- 10.18’s external token configuration: [Administration - Cumulocity IoT Guides](https://cumulocity.com/guides/10.18.0/users-guide/administration/#configuring-authentication-with-oauth2-access-tokens-from-authorization-servers)

---

<div class="post-metadata">

**Author:** ![jahntech.cj](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/jahntech.cj/32/14059_2.png) [@jahntech.cj](https://community.cumulocity.com/u/jahntech.cj)\
**Post date:** [November 8, 2023, 7:31am UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365/6 "2023-11-08T07:31:06Z")

</div>

> [@Matthias.Burkert](#):
>
> “info”: “ttps://www.cumulosity.com/guides/reference/rest-implementation//#a-name-error-reporting-a-error-reporting”

Not idea if this relevant here, but the URL cannot be valid. The “h” is missing from https and “cumulo **s** ity” also doesn’t look right.

---

<div class="post-metadata">

**Author:** ![Matthias.Burkert](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@Matthias.Burkert](https://community.cumulocity.com/u/Matthias.Burkert)\
**Post date:** [November 13, 2023, 8:32am UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365/7 "2023-11-13T08:32:47Z")

</div>

I was retyping it an links ar prohibided here in this forum.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [May 11, 2024, 8:33am UTC](https://community.cumulocity.com/t/token-based-api-log-in-for-cumulocity-api-in-version-10-18/3365/8 "2024-05-11T08:33:31Z")

</div>

Closed on May 11, 2024, 8:33am UTC

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