mirror of
https://gitlab.com/fabinfra/fabaccess/fabaccess-api-cs.git
synced 2025-03-12 06:41:51 +01:00
Init claims
This commit is contained in:
parent
dbf19566db
commit
296c0a29ee
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -6,4 +6,4 @@
|
||||
url = https://github.com/kjkriegel/S22.Sasl.git
|
||||
[submodule "FabAccessAPI/schema"]
|
||||
path = FabAccessAPI/schema
|
||||
url = https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
|
||||
url = ../fabaccess-api.git
|
||||
|
@ -447,7 +447,7 @@ namespace FabAccessAPI
|
||||
Response? response = await authentication.Step(data);
|
||||
while (!saslMechanism.IsCompleted)
|
||||
{
|
||||
if (response.Failed != null)
|
||||
if (response != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@ -466,18 +466,19 @@ namespace FabAccessAPI
|
||||
{
|
||||
return response.Successful.Session;
|
||||
}
|
||||
else if (response.Failed != null)
|
||||
else if (response.Error != null)
|
||||
{
|
||||
switch (response.Failed.Code)
|
||||
switch (response.Error.Reason)
|
||||
{
|
||||
case Response.Error.badMechanism:
|
||||
case Response.Reason.badMechanism:
|
||||
throw new BadMechanismException();
|
||||
case Response.Error.invalidCredentials:
|
||||
case Response.Reason.invalidCredentials:
|
||||
throw new InvalidCredentialsException();
|
||||
case Response.Error.aborted:
|
||||
case Response.Error.failed:
|
||||
case Response.Reason.aborted:
|
||||
case Response.Reason.failed:
|
||||
default:
|
||||
throw new AuthenticationFailedException(response.Failed.AdditionalData.ToArray());
|
||||
throw new AuthenticationFailedException();
|
||||
// TODO throw new AuthenticationFailedException(response.Error.AdditionalData.ToArray());
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -491,12 +492,17 @@ namespace FabAccessAPI
|
||||
/// </summary>
|
||||
private async Task<ServerData> _GetServerData(IBootstrap bootstrap)
|
||||
{
|
||||
var release = await bootstrap.GetServerRelease().ConfigureAwait(false);
|
||||
var info = await bootstrap.GetServerInfo().ConfigureAwait(false);
|
||||
|
||||
ServerData serverData = new ServerData()
|
||||
{
|
||||
APIVersion = await bootstrap.GetAPIVersion().ConfigureAwait(false),
|
||||
Mechanisms = new List<string>(await bootstrap.Mechanisms().ConfigureAwait(false)),
|
||||
ServerName = (await bootstrap.GetServerRelease().ConfigureAwait(false)).Item1,
|
||||
ServerRelease = (await bootstrap.GetServerRelease().ConfigureAwait(false)).Item2,
|
||||
Mechanisms = new List<Mechanism>(await bootstrap.Mechanisms().ConfigureAwait(false)),
|
||||
ServerName = release.Item1,
|
||||
ServerRelease = release.Item2,
|
||||
SpaceName = info.Item1,
|
||||
InstanceURL = info.Item2
|
||||
};
|
||||
|
||||
return serverData;
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FabAccessAPI.Schema;
|
||||
|
||||
namespace FabAccessAPI
|
||||
{
|
||||
@ -8,6 +9,9 @@ namespace FabAccessAPI
|
||||
public Schema.Version APIVersion;
|
||||
public string ServerName;
|
||||
public string ServerRelease;
|
||||
public List<string> Mechanisms;
|
||||
public string SpaceName;
|
||||
|
||||
public string InstanceURL;
|
||||
public List<Mechanism> Mechanisms;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user