Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URGENT: Error calling authenticate/all method(s) on LIVE OASIS WEB API #14

Closed
dellams opened this issue Feb 18, 2021 · 0 comments
Closed
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@dellams
Copy link
Collaborator

dellams commented Feb 18, 2021

URI: http://oasisplatform.world/api/avatar/authenticate
Post Body Data:
{
"email": "davidellams@hotmail.com",
"password": "my-super-secret-password"
}

Use Postman or something similar to send the above and you will get back this:

{"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"|a8a2c5a-4e9cfc5e41a08a61.","errors":{"$":["The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0."],"setGlobally":["The value 'authenticate' is not valid."],"providerType":["The value 'avatar' is not valid."]}}

setGlobally and providerType are optional params for the authenticate method.

    /// <summary>
    /// Authenticate and log in using the given avatar credentials. Pass in the provider you wish to use. Set the setglobally flag to false for this provider to be used only for this request or true for it to be used for all future requests too.
    /// </summary>
    /// <param name="model"></param>
    /// <param name="providerType"></param>
    /// <param name="setGlobally"></param>
    /// <returns></returns>
    [HttpPost("authenticate/{providerType}/{setGlobally}")]
    public ActionResult<AuthenticateResponse> Authenticate(AuthenticateRequest model, ProviderType providerType = ProviderType.Default, bool setGlobally = false)
    {
        GetAndActivateProvider(providerType, setGlobally);
        return Authenticate(model);

        AuthenticateResponse response = _avatarService.Authenticate(model, ipAddress());

        if (!response.IsError && response.Avatar != null)
            setTokenCookie(response.Avatar.RefreshToken);

        return Ok(response);
    }

    
    /// <summary>
    /// Authenticate and log in using the given avatar credentials.
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    [HttpPost("authenticate")]
    public ActionResult<AuthenticateResponse> Authenticate(AuthenticateRequest model)
    {
        AuthenticateResponse response = _avatarService.Authenticate(model, ipAddress());

        if (!response.IsError && response.Avatar != null)
            setTokenCookie(response.Avatar.RefreshToken);

        return Ok(response);
    }

Full code here:

https://github.com/NextGenSoftwareUK/Our-World-OASIS-API-HoloNET-HoloUnity-And-.NET-HDK/blob/master/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/AvatarController.cs

NOTE: IT LOOKS LIKE THIS IS ALSO AN ISSUE FOR ALL METHODS ON THE WEB API SO SOMETHING DEFINTLEY GOING ON WITH THE DEPLOYMENT? PLEASE FIX ASAP! THANK YOU. It works locally fine so I can't work out what is going on?

This may also be related to another issue that started occurring out of the blue after no code had been changed:

#15

Any help would be really appreciated thanks. :)

@dellams dellams added bug Something isn't working help wanted Extra attention is needed labels Feb 18, 2021
@dellams dellams changed the title Error calling authenticate method on OASIS WEB API Error calling authenticate/all method(s) on OASIS WEB API Feb 18, 2021
@dellams dellams changed the title Error calling authenticate/all method(s) on OASIS WEB API Error calling authenticate/all method(s) on LIVE OASIS WEB API Feb 18, 2021
@dellams dellams changed the title Error calling authenticate/all method(s) on LIVE OASIS WEB API URGENT: Error calling authenticate/all method(s) on LIVE OASIS WEB API Feb 18, 2021
@dellams dellams closed this as completed Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant