0

Is there a way to replace "Basic Authentication" with "Form Authentication" in W20?. The documentation only refers to the "basicAuth" but not to an authentication with Login (authentication by form). The app is made with AngularJS and W20, in the backend it uses SeedStack and Java 8. Could you help us to solve this problem? Thanks

The documentation only refers to the "basicAuth" but not to an authentication with Login (authentication by form). The app gives a 401 error and opens a popup for username/password registration when loading the URL. The app does not have a LOGIN page.

1 Answers1

0

Hi Hugo Orlando Gonzalez!

I'm not very familiar with the W20 library or SeedStack, so I'm going off of my experience using other authentication schemes, so I may be rather abstract.

According to:

You would have to setup data-ng-submit="form.submit()" to call:

$scope.form = {
  model: { /* ... */ },
  fields: [{ /* the form login fields... */ }],
  submit: function () {
    // send form (XHR, AJAX, fetch, etc.) request to back-end
    // get token for  Authorization  header or get cookie for server session
    // save to LocalStorge or in a cookie, whichever is used on your back-end
  }
}

And then save the token in LocalStorage, or in a cookie that's then checked for authentication on the server.

I hope it helps.

Nyctfall
  • 71
  • 6