# Capability-Authentication & Authorization (Spring)

Spring Security is a powerful and customizable authentication and access control mechanism that Code-Wizard provides as a Capability for applications created by Spring OData as Spring Security is used to secure Spring-based applications through robust authentication and authorization.

<figure><img src="https://2133491438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSDKNr1jp5RbNsbYPXuKP%2Fuploads%2FaJ4BAE87Zhmu36FL4uFl%2Fspringsecurity.png?alt=media&#x26;token=f6bd69e1-c284-47ec-89ce-011bb833cbf7" alt=""><figcaption><p>Spring Security</p></figcaption></figure>

**Admin API setup**

**Add Host Info**&#x20;

To add host you need to call POST Add Host Info API with ip, port, scheme, serviceName prefix of generated app, and name for generated application.

**GET List All Host**&#x20;

To review all list of hosts

**Del Host Info By Id**&#x20;

To delete host you can call this API

**POST Signup**

Register API interacts with Spring Security

**POST Login**

To verify login you call this API by passing userName and password, once you post the response your response contains a bearer token, copy it and navigate to Authorization tab select type as "Bearer Token" and pass the copied token.

**POST Add Role**&#x20;

To add roles you need to call this

**PUT Add User Roles**&#x20;

To add user role you need to call this API and specify user id and role id
