2018-07-26 17:10:57 +02:00
|
|
|
namespace cli
|
|
|
|
|
{
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2019-06-25 02:58:35 +01:00
|
|
|
using System.Runtime.Serialization;
|
2018-07-26 17:10:57 +02:00
|
|
|
using Newtonsoft.Json;
|
2019-06-25 17:11:16 +01:00
|
|
|
using Yavsc;
|
2018-07-26 17:10:57 +02:00
|
|
|
|
|
|
|
|
public class ConnectionSettings
|
|
|
|
|
{
|
2018-08-05 04:16:21 +02:00
|
|
|
public string ClientId { get; set; }
|
|
|
|
|
public string ClientSecret { get; set; }
|
|
|
|
|
public string Authority { get; set; }
|
|
|
|
|
public string Audience { get; set; }
|
2018-07-26 17:10:57 +02:00
|
|
|
public string SiteAccessSheme { get; set; } = "http";
|
2019-06-25 02:58:35 +01:00
|
|
|
public int Port { get; set; }
|
2018-07-26 17:10:57 +02:00
|
|
|
public string Scope { get; set; } = "profile";
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string AuthorizeUrl {get {
|
2019-06-25 02:58:35 +01:00
|
|
|
return Port==0 ? $"{SiteAccessSheme}://{Authority}/authorize" :
|
|
|
|
|
$"{SiteAccessSheme}://{Authority}:{Port}/authorize" ;
|
2018-07-26 17:10:57 +02:00
|
|
|
} }
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string RedirectUrl {get {
|
2019-06-25 02:58:35 +01:00
|
|
|
return Port==0 ? $"{SiteAccessSheme}://{Authority}/oauth/success" :
|
|
|
|
|
$"{SiteAccessSheme}://{Authority}:{Port}/oauth/success" ;
|
2018-07-26 17:10:57 +02:00
|
|
|
} }
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
[JsonIgnore]
|
2019-06-25 02:58:35 +01:00
|
|
|
public string AccessTokenUrl { get {
|
|
|
|
|
return Port==0 ? $"{SiteAccessSheme}://{Authority}/token":
|
|
|
|
|
$"{SiteAccessSheme}://{Authority}:{Port}/token";
|
|
|
|
|
} }
|
|
|
|
|
|
2020-10-18 23:45:02 +01:00
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
[JsonIgnore]
|
2020-12-29 19:42:37 +00:00
|
|
|
public string StreamingUrl { get {
|
2020-10-18 23:45:02 +01:00
|
|
|
return Port==0 ? $"ws://{Authority}"+Constants.StreamingPath:
|
|
|
|
|
$"ws://{Authority}:{Port}"+Constants.StreamingPath;
|
|
|
|
|
} }
|
|
|
|
|
|
2018-07-26 17:10:57 +02:00
|
|
|
}
|
2020-10-18 23:00:17 +01:00
|
|
|
}
|