-
Notifications
You must be signed in to change notification settings - Fork 492
User Authentication
Travis Tidwell edited this page Mar 6, 2017
·
14 revisions
Now that you have rendered a form, you will probably want to allow your users to authentication into your Form.io project from within your own application. To do this, you will be using the Form.io Authentication Service. You can install this provider into your application using the combination of the FormioAuthService and FormioAuthConfig which is used to provide the configurations to this service.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormioModule } from 'ng2-formio';
import { FormioAuthService, FormioAuthConfig } from 'ng2-formio/auth';
import { MainComponent } from './main';
@NgModule({
imports: [
BrowserModule,
FormioModule
],
declarations: [
MainComponent
],
providers: [
FormioAuthService,
{
provide: FormioAuthConfig,
useValue: {
app: {
appUrl: 'https://myproject.form.io',
apiUrl: 'https://api.form.io'
},
login: {
form: 'user/login'
},
register: {
form: 'user/register'
}
}
}
],
bootstrap: [
MainComponent
]
})
export class AppModule {}