Skip to main content
Answer

Sidebar plugin preferences

  • May 9, 2024
  • 4 replies
  • 248 views

pablobfonseca

Hi, I’ve built a front sidebar plugin a couple of years ago and I was using the auth_secret to authenticate the users from front to my app, before I was doing something like:

export function getInstallationInformation(callback) {
callback = once(callback);
Front.contextUpdates.subscribe(context => {
callback({authSecret: context.preferences.authSecret});
});
}

Now I’m refactoring the plugin, and I noticed that in the docs it says that the auth_secret is going to be sent in the URL.

Does front still support the the context.preferences ?

Thank you!

Best answer by jason

Yes - the user can still configure the plugin URL (and query string params) to be whatever they need. 
Front will append an auth_secret parameter matching the Auth Secret key in the plugin app config.

So for the example pictured below, the actual URI being requested would be;

https://front-plugin.example.com/auth_token=abc123?auth_secret=984cc92fb2ced266

You can have your users set an auth_token param for your own use and reach that on connecting. 

 

It’s also possible to configure authentication via OAuth, or having the user enter something like an auth token, then setting a cookie for their browser session. 

 

 

4 replies

jason
Forum|alt.badge.img+8
  • Fronteer
  • May 9, 2024

Hi, The context.preferences object is still present in the v1.x plugin SDK, but it will not contain the auth_secret. As you pointed out, this will be provided as a query string parameter in the plugin URL only. 

 

 


pablobfonseca
  • Author
  • Conversationalist
  • May 9, 2024

Hi Jason, thank you for your answer!

But is it still gonna be configurable by the user? because the way we do it is, we provide an auth_token and they have to add it to the settings, is it still the case?

Thank you very much!


jason
Forum|alt.badge.img+8
  • Fronteer
  • Answer
  • May 9, 2024

Yes - the user can still configure the plugin URL (and query string params) to be whatever they need. 
Front will append an auth_secret parameter matching the Auth Secret key in the plugin app config.

So for the example pictured below, the actual URI being requested would be;

https://front-plugin.example.com/auth_token=abc123?auth_secret=984cc92fb2ced266

You can have your users set an auth_token param for your own use and reach that on connecting. 

 

It’s also possible to configure authentication via OAuth, or having the user enter something like an auth token, then setting a cookie for their browser session. 

 

 


pablobfonseca
  • Author
  • Conversationalist
  • May 10, 2024

Awesome! thank you very much Jason!