FINERACT-1820: Update for Authentication in Legacy Docs

This commit is contained in:
Vic Romero
2022-11-27 20:25:05 +01:00
committed by Arnold Gálovics
parent a370875ce8
commit 2f4dcbdd6c
3 changed files with 18 additions and 7 deletions
@@ -26,7 +26,7 @@ import org.apache.fineract.useradministration.data.RoleData;
/**
* Created by sanyam on 13/8/17.
*/
final class AuthenticationApiResourceSwagger {
public final class AuthenticationApiResourceSwagger {
private AuthenticationApiResourceSwagger() {
@@ -21,6 +21,7 @@ package org.apache.fineract.portfolio.self.security.api;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -30,6 +31,7 @@ import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.apache.fineract.infrastructure.security.api.AuthenticationApiResource;
import org.apache.fineract.infrastructure.security.api.AuthenticationApiResourceSwagger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Scope;
@@ -54,6 +56,7 @@ public class SelfAuthenticationApiResource {
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Verify authentication", description = "Authenticates the credentials provided and returns the set roles and permissions allowed.\n\n"
+ "Please visit this link for more info - https://fineract.apache.org/legacy-docs/apiLive.htm#selfbasicauth")
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = AuthenticationApiResourceSwagger.PostAuthenticationRequest.class)))
@ApiResponses({
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfAuthenticationApiResourceSwagger.PostSelfAuthenticationResponse.class))) })
public String authenticate(final String apiRequestBodyAsJson) {
@@ -39003,12 +39003,16 @@ Request Body:
</div>
<div class="method-example">
<code class="method-declaration">
POST https://DomainName/api/v1/authentication?username={username}&password={password}
POST https://DomainName/api/v1/authentication
</code>
<code class="method-request">
POST authentication?username=mifos&password=password
POST authentication
Content-Type: application/json
No Request Body
Request Body
{
"username": "mifos",
"password": "password"
}
</code>
<p>Example response of autentication for user that is not linked with any staff.</p>
<code class="method-response">
@@ -46956,12 +46960,16 @@ No Request Body
</div>
<div class="method-example">
<code class="method-declaration">
POST https://DomainName/api/v1/self/authentication?username={username}&password={password}
POST https://DomainName/api/v1/self/authentication
</code>
<code class="method-request">
POST self/authentication?username=mifos&password=password
POST self/authentication
Content-Type: application/json
No Request Body
Request Body
{
"username": "mifos",
"password": "password"
}
</code>
<p>Example response of autentication for user</p>
<code class="method-response">