Redirect to Confluence-Space from my C# application and avoid login page.
Asked by Bibin T Philip:

I have a desktop application, up on click on a button I need to open default browser loaded with one of my Confluence Space(This confluence space is restricted for anonymous user).

I have created a user in Atlassian with access to this particular confluence space. How can I authenticate through my desktop application (in background) so that when my application user clicks on the button he should able to see the Confluence space in his browser.


Answers:
author: Neil
body: As far as I know, there isn't a way for you to accomplish exactly what you're trying to do. When a user logs in, session information is established using browser-based storage mechanisms (secure cookies, local storage, session storage, etc.).

Out of the box, the Confluence Cloud product does support public/open access, allowing anonymous users to browse/read content without the need to login; however, the caveat is that if you do have spaces that you intend to keep private, that you'll need to configure space and content permissions, and do it well.

Per [@tharaka92](/t5/user/viewprofilepage/user-id/1782304)message above, I responded on that Developer Community thread stating what I said above, with perhaps a little more detail.


author: Shannon S
body: Hello Bibin,

Thank you for contacting us about this. It sounds like you'll need to impersonate the user via the application, so these pages should be helpful to you:

* [User impersonation for Connect apps](https://developer.atlassian.com/cloud/confluence/user-impersonation-for-connect-apps/)
* [OAuth 2.0 (3LO) for apps](https://developer.atlassian.com/cloud/confluence/oauth-2-authorization-code-grants-3lo-for-apps/)

If you're writing a Atlassian Connect app, you can follow the [User Impersonation for Connect Apps](https://developer.atlassian.com/cloud/confluence/user-impersonation-for-connect-apps/) for details.

I hope that helps, but if you have any further issues or development-related queries, you can raise a new thread from our Developer Community, available on our [Developer Resources](https://developer.atlassian.com/resources) page.

Take care,

Shannon

comments: author: tharaka92
body: Hi Shannon,  

Thanks for your response! I found myself in the same situation as Bibin and I'm glad he asked this question. I went through the links provided in your answer but it seems they are valid only for making API requests. But what we need is to redirect users to the space page(once the button is clicked) without prompting for username and password. Can this also be done using above mentioned links?  

Thanks!


author: Shannon S
body: Hello [@tharaka92](/t5/user/viewprofilepage/user-id/1782304),

Thank you for following-up on this thread.

The links I have provided are *not* just for use with API. In the [2nd article](https://developer.atlassian.com/cloud/confluence/oauth-2-authorization-code-grants-3lo-for-apps/?_ga=2.97512991.1648646019.1580721151-1642555208.1571221417) especially, it states on the top of the article that you can use the method in the following situations:

*
  > **[Connect apps](https://developer.atlassian.com/cloud/confluence/getting-started/)** : Use [JWT](https://developer.atlassian.com/cloud/confluence/authentication-for-apps/). You can also use [OAuth 2.0 user impersonation](https://developer.atlassian.com/cloud/confluence/user-impersonation-for-connect-apps/).
*
  > **[Other apps](https://developer.atlassian.com/apps)**: Use OAuth 2.0 (3LO) for authentication and authorization.
*
  > **Not using an app** : Use OAuth 1.0a. See [OAuth for REST APIs (Jira platform)](https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/), [OAuth for REST APIs (Jira Service Desk)](https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/), or [OAuth for REST APIs (Confluence)](https://developer.atlassian.com/cloud/confluence/basic-auth-for-rest-apis/).

In order for your button to work, you will need to program it in a way that uses OAuth 2.0 for user impersonation.

I would love to be able to tell you specifically how to program user impersonation into your button, but it requires someone with more development knowledge. This forum isn't the best place for that, as I let Bibin know earlier. You can find help for that via our Developer Community on the [Developer Resources](https://developer.atlassian.com/resources) page.

Regards,

Shannon


author: tharaka92
body: Understood.   

Thanks for the quick reply.


author: Bibin T Philip
body: I have already placed a developer support , but he is suggest to use application links .

See my post here. <https://community.developer.atlassian.com/t/redirect-to-confluence-space-from-my-c-application-and-avoid-login-page/35197/3>

[@tharaka92](/t5/user/viewprofilepage/user-id/1782304)please let me know if you got a viable solution.


author: tharaka92
body: [@Bibin T Philip](/t5/user/viewprofilepage/user-id/3713732) Hey, Yes I saw your question yesterday. But I posted a new one anyway.  

Here it is - <https://community.developer.atlassian.com/t/redirect-users-to-a-confluence-space-overview-page-without-going-through-the-confluence-login-flow/35431>  

I will let you know if we pull this off.


author: Rahul Jain
body: [@Bibin T Philip](/t5/user/viewprofilepage/user-id/3713732) [@tharaka92](/t5/user/viewprofilepage/user-id/1782304) I know it's been very long, but can you please suggest what approach you took to implement the required functionality of avoiding login page.


Tags: atl-adm

atl-dev

confluence-cloud