WikiTransformationProject / wikitraccs-releases

Releases, issues and discussions for WikiTraccs from the Wiki Transformation Project
https://www.wikitransformationproject.com
8 stars 0 forks source link

Confluence Cloud: Change from v1 API to v2 API [backend, deadline: December 2024] #118

Open heinrich-ulbricht opened 3 months ago

heinrich-ulbricht commented 3 months ago

Atlassian is deprecating v1 REST API in J̶u̶n̶e̶ December (although the moved the deadline about 3 times already...). Need to switch to v2 API, that makes some things more complicated.

I'm keeping an eye on this discussion, where Atlassian is yet to finalize the timeline: image

UPDATE

There is an update from Atlassian, extending the removal deadline for deprecated v1 APIs to December 2, 2024: https://community.developer.atlassian.com/t/update-to-confluence-v1-api-deprecation-timeline/79687

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment, or this will be closed in 10 days.

digitalanalogue9 commented 2 months ago

Hey @heinrich-ulbricht, do you have a rough ETA for the Confluence Cloud stuff working ?

Thanks. Good luck and happy Friday Dan

heinrich-ulbricht commented 2 months ago

@digitalanalogue9 The Cloud stuff is working pretty well at the moment, it will just stop working in June according to Atlassian. Currently WikiTraccs uses the v1 REST API, which is the same as in Confluence Server and Data Center.

I plan switching to the v2 Cloud API in June, although I anticipate Atlassian extending the deadline. In this case I'll take more time.

So, long story short: just try migrating from Confluence Cloud to SharePoint Online. And if you already did so and found blocking issues I'd like to know about them, to remove them.

Edit: I just saw the issue description said "April". I updated that to "June".

digitalanalogue9 commented 2 months ago

OK cool - Thanks for replying super promptly! I read the comments that we could give it a bash but no dice for me .. yet :)

I can hang loose until June but details below.

Am running WikiTraccs.GUI 1.16.2. Our Confluence Auth set up is SSO - Membership of an AAD Security group feeds the allowed users to Confluence cloud

image

I've set up up the API key in Atlassian cloud
When I click "Test Confluence Connection" - it opens Chrome (says being automated by) but the url is empty

image

If I close the browser, the GUI shuts down

Last 4 messages from log file [ 18:48:49 DBG] [https://[redacted].atlassian.net/wiki/] Calling 'rest/api/user/current' to retrieve current user info | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceGlobalApiAccessor [ 18:48:49 DBG] [https://[redacted].atlassian.net/wiki/] [RelayToSeleniumMessageHandler] [REQUEST ] GET on '"rest/api/user/current"' with headers [] (body length: 0) | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceHttpClientFactory [ 18:48:49 DBG] [https://[redacted].atlassian.net/wiki/] [RelayToSeleniumMessageHandler] Showing message in remote-controlled browser: [REQUEST ] GET on 'rest/api/user/current'... | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceHttpClientFactory [ 18:48:49 DBG] [https://[redacted].atlassian.net/wiki/] Done: Retrieving tenants for user null | WikiTraccs.Shared.ConfluenceInternal.ConfluenceInternalApiAccessor.ConfluenceGlobalApiAccessor

If I try the url "https://[redacted].atlassian.net/wiki/rest/api/user/current" in Edge, I get the json successfully back with user info

NB: I switched to try to Interactive login. -Chrome browser opens but no url populated (although ?that might be not important?. Closing down doesn't close down the gui but get an object reference not set error message.

heinrich-ulbricht commented 2 months ago

@digitalanalogue9 Sure! I don't fully understand the AAD SSO + API Key scenario, yet. Before you (or WikiTraccs in this case) can use the API key, you have to authenticate with Azure AD/Entra ID, right? So using just the API key to authenticate wouldn't work. (It's like: how would a PowerShell script look like, that successfully authenticates in your environment?)

But I would expect that interactive login works.

From the logs I can see that you have this "proxy calls" option selected: image

So far, this was the workaround that always worked (although it shouldn't be the normal case, as the connection to Chrome is a bit flaky). Does it work without this option checked?

In my view there are currently the following auth scenarios for Confluence Cloud:

  1. API Key only (basic auth) => supported by WikiTraccs via "Personal Token" (note: don't check hte "proxy calls" option here)
  2. AAD SSO + API Key => probably not supported? that's your scenario, I guess...
  3. AAD SSO / interactive login => should be supported by WikiTraccs via "Interactive Login", or if nothing helps, above "proxy calls" setting
  4. OAuth? Would that work in your environment, compliance-wise?
digitalanalogue9 commented 2 months ago

Hey @heinrich-ulbricht I turned off Proxy Confluence API calls and tried out

Token : image

Interactive Login. Is it expected behaviour that Chrome opens with about:blank ? (neat use of ?selenium? tho :) )

I looked at some code I wrote to create a report out of who-has-made-what in confluence

Running this from VS works image

so I think option 1 should be good. Just before bed test - I'll copy the auth information out of that code image

Problem between chair and keyboard. Think a C/P issue

Will give it all a test next week and then confirm the budget request!

heinrich-ulbricht commented 2 months ago

@digitalanalogue9 Sounds good.

Although I need to check this "about:blank" issue. That doesn't sound right.