We need Need to open a browser for SSO login when the writer access plugin functionalities
-
- Posts: 144
- Joined: Fri Feb 28, 2020 4:02 pm
We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by vishwavaranasi »
please help us to implement the same.
Thanks,
vishwa
vishwa
-
- Posts: 496
- Joined: Thu Sep 04, 2014 4:22 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by cristi_talau »
I assume that you have a plugin for Oxygen XML Editor that connects to a server that has OAuth support and you want to use this support to authenticate the user.
First of all, there are multiple OAuth grant types [1] and the recommended one for a Native Application (Oxygen XML Editor falls in this category) is the PKCE workflow [2].
To open a browser you can use the following API: ro.sync.exml.workspace.api.WorkspaceUtilities.openInExternalApplication(). If you have more specific questions, please let us know.
Best,
Cristian
[1] https://oauth.net/2/grant-types/
[2] https://oauth.net/2/pkce/
-
- Posts: 144
- Joined: Fri Feb 28, 2020 4:02 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by vishwavaranasi »
is there any samples in oxygenxml to connect plugin for Oxygen XML Editor that connects to a server that has OAuth support?
We have a plugin where the user clicks one of the Menu Options ..we want the redirection to Oauth login page , here question is once we have the access token from Oauth server , how do we can use the user credentials ..i Mean this is a purely desktop application right ..how do we maintain the session details like username for the user who logged ?
do we have any samples in oxygenxml that we can start looking?
Thanks for your help.
Thanks,
vishwa
vishwa
-
- Posts: 496
- Joined: Thu Sep 04, 2014 4:22 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by cristi_talau »
Unfortunately we do not have any public samples that implement the OAuth flow.
Once you have the token in the Web browser to send it to the Oxygen desktop application there are several approaches:
1. Use an Oxygen plugin to open a server on localhost and make a POST request to that server.
2. Use a public server where the Web browser posts the token and Oxygen desktop application queries to retrieve it (maybe once every 2 seconds).
Once you have the OAuth token in the Oxygen application, you can make a request to the server to find the name of the current user.
Best,
Cristian
-
- Posts: 144
- Joined: Fri Feb 28, 2020 4:02 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by vishwavaranasi »
as a initial start i wanted to use Google OAuth Credentials to verify the user who tries to access the oxygen plugin , is this possible?
would you please help me if any samples or blogs that i ca refer for this implementation?
Thanks,
vishwa
vishwa
-
- Site Admin
- Posts: 95
- Joined: Thu Jun 09, 2016 2:01 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by Gabriel Titerlea »
We don't have an example plugin but I think the documentation from google is a good resource for your use-case: https://developers.google.com/identity/ ... native-app
This together with the ro.sync.exml.workspace.api.WorkspaceUtilities.openInExternalApplication() API, mentioned by Cristian, can be a starting point.
Best,
Gabriel
-
- Posts: 144
- Joined: Fri Feb 28, 2020 4:02 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by vishwavaranasi »
how do we get the instance of WorkspaceUtilities to call this ro.sync.exml.workspace.api.WorkspaceUtilities.openInExternalApplication
tried searching forum didn't find anything , Thanks.
vishwa
-
- Posts: 144
- Joined: Fri Feb 28, 2020 4:02 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by vishwavaranasi »
i got to know how to invoke openInExternalApplication
vishwa
-
- Posts: 144
- Joined: Fri Feb 28, 2020 4:02 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by vishwavaranasi »
I have opened a web page on local host from my plugin as below
pluginWorkspaceAccess.openInExternalApplication("http://localhost:8080/OauthBasicWebApp/index.jsp", false, "text/html"); where pluginWorkspaceAccess is object of StandalonePluginWorkspace
this is opened a browser , index.jsp has the google sign-in , it does the authenticated and authorized , so question here , how do we return back the control from external page to again back to plugin ?
please help us here?
vishwa
-
- Site Admin
- Posts: 95
- Joined: Thu Jun 09, 2016 2:01 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by Gabriel Titerlea »
Google recommends [1] showing a message that instructs the user to close the browser and return to your app.
Best,
Gabriel
[1] https://developers.google.com/identity/ ... i_loopback
-
- Posts: 144
- Joined: Fri Feb 28, 2020 4:02 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by vishwavaranasi »
is this also applicable in case of our oxygen plugins ?, for example we have our own authorization/authentication server (not google sing-in )to talk to and once the user is a valid user
is it recommended that user closes the browser and return back to oxygen plugin for further work to do?
vishwa
-
- Site Admin
- Posts: 95
- Joined: Thu Jun 09, 2016 2:01 pm
Re: We need Need to open a browser for SSO login when the writer access plugin functionalities
Post by Gabriel Titerlea »
For Oxygen any flow is acceptable. The answer depends on the user-experience you want to provide to plugin users.is it recommended that user closes the browser and return back to oxygen plugin for further work to do?
Ideally the user would be returned to the app (Oxygen Plugin) automatically after the authentication flow is completed.
But to do that you would have to register a Custom URL scheme (which is a cumbersome process), as described in https://datatracker.ietf.org/doc/html/rfc7636#section-1
The Custom URL Scheme would start Oxygen with a given URL. And you could handle that in your plugin by registering an editorAboutToBeOpenedVeto event: https://www.oxygenxml.com/InstData/Edit ... a.net.URL-
This post might prove useful: https://clarifyforme.com/posts/56446141 ... ative-apps
Best,
Gabriel
Return to “SDK-API, Frameworks - Document Types”
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service