Need to open a browser for SSO login in oxygen

<oXygen/> general issues.
tarinisunil
Posts: 2
Joined: Thu Mar 04, 2021 9:19 am

Need to open a browser for SSO login in oxygen

Post by tarinisunil » Thu Mar 04, 2021 9:27 am

Hi,

We create a plugin which works with oxygen & CMS. We have a specific requirement to open a browser for SSO login for the user to login into a specific CMS for access. Earlier we did this with JavaFX WebView but due to some issues it is not opening in windows correctly. It works fine in Mac. Is it possible to open the default system browser and get the cookies from that in oxygen? or is there an integration available to embed a native browser in Oxygen so that we can ask the user to login and get the cookies from there

Thanks
Regards
Tarini

Gabriel Titerlea
Posts: 53
Joined: Thu Jun 09, 2016 2:01 pm

Re: Need to open a browser for SSO login in oxygen

Post by Gabriel Titerlea » Thu Mar 04, 2021 1:09 pm

Hello,
Is it possible to open the default system browser and get the cookies from that in oxygen?
It's not possible. I'll describe how we share the authentication from the browser with Oxygen Editor in our Content Fusion product:

Code: Select all

┌────────┐                                    ┌─────┐                            ┌─────────┐
│        │                                    │     │                            │         │
│ Plugin │                                    │ CMS │                            │ Browser │
│        │                                    │     │                            │         │
└───┬────┘                                    └──┬──┘                            └────┬────┘
    │                                            │                                    │
    │                /authorize                  │                                    │
    ├───────────────────────────────────────────►│                                    │
    │                                            │                                    │
    │                                            │                                    │
    │            authCode + checkAuthCode        │                                    │
    │◄───────────────────────────────────────────┤                                    │
    │                                            │                                    │
    │                                            │                                    │
    │                                  /auth?auth=authCode (*)                        │
    ├────────────────────────────────────────────┬───┬─────────────────────────────┬─►├┐
    │                                            │   │ User presses a button to    │  ││
    │                                            │   │ grant your plugin access to │  ││
    │        /checkAuth?auth=checkAuthCode       │   │ his/her account.            │  ││
    ├────────┬───────────────────────────┬──────►├┐  └─────────────────────────────┘  ││
    │        │ The CMS keeps the request │       ││                                   ││
    │        │ open until it receives a  │       ││                                   ││
    │        │ grant access request from │       ││                                   ││
    │        │ the browser (*)           │       ││                                   ││
    │        └───────────────────────────┘       │◄───────────────────────────────────┼┘
    │                                            ││                                   │
    │                                            ││                                   │
    │                                            ││                                   │
    │                accessToken                 ││                                   │
    │◄───────────────────────────────────────────┼┘                                   │
    │                                            │                                    │
    │                                            │                                    │
    │                                            │                                    │
    │    use accessToken to authorize requests   │                                    │
    ├───────────────────────────────────────────►│                                    │
    │                                            │                                    │

You can also read about GitHub's device flow that describes a similar authentication process. Or you could implement OAuth 2.0 for Native Apps.

Best,
Gabriel

tarinisunil
Posts: 2
Joined: Thu Mar 04, 2021 9:19 am

Re: Need to open a browser for SSO login in oxygen

Post by tarinisunil » Wed Mar 10, 2021 11:19 am

Hello ,

I had one more query, is it possible to have a plugin which is a mix of java and javascript? Like the main plugin is maven based but a small part of it is javascript based.
Is there any sample documentation around it

Thanks
Regards
Tarini

cristi_talau
Posts: 326
Joined: Thu Sep 04, 2014 4:22 pm

Re: Need to open a browser for SSO login in oxygen

Post by cristi_talau » Wed Mar 10, 2021 7:48 pm

Hello,

Yes. A plugin can have both Java and JavaScript extensions [1].

Best,
Cristian

[1] https://www.oxygenxml.com/doc/versions/ ... in-js.html

Post Reply