|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) |
| 3 | + * See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers |
| 4 | + * for more information concerning the license and the contributors participating to this project. |
| 5 | + */ |
| 6 | +using Microsoft.AspNetCore.Authentication; |
| 7 | + |
| 8 | +namespace AspNet.Security.OAuth.SuperOffice |
| 9 | +{ |
| 10 | + /// <summary> |
| 11 | + /// Contains constants specific to the <see cref="SuperOfficeAuthenticationHandler"/>. |
| 12 | + /// </summary> |
| 13 | + public static class SuperOfficeAuthenticationConstants |
| 14 | + { |
| 15 | + public static class ClaimNames |
| 16 | + { |
| 17 | + /// <summary> |
| 18 | + /// Tenant's user identity. |
| 19 | + /// </summary> |
| 20 | + public const string AssociateId = "http://schemes.superoffice.net/identity/associateid"; |
| 21 | + |
| 22 | + /// <summary> |
| 23 | + /// Current user's company name. |
| 24 | + /// </summary> |
| 25 | + public const string CompanyName = "http://schemes.superoffice.net/identity/company_name"; |
| 26 | + |
| 27 | + /// <summary> |
| 28 | + /// Current user tenant identifier. |
| 29 | + /// </summary> |
| 30 | + public const string ContextIdentifier = "http://schemes.superoffice.net/identity/ctx"; |
| 31 | + |
| 32 | + /// <summary> |
| 33 | + /// Current SuperId user email address. |
| 34 | + /// </summary> |
| 35 | + public const string Email = "http://schemes.superoffice.net/identity/email"; |
| 36 | + |
| 37 | + /// <summary> |
| 38 | + /// Current user first name. |
| 39 | + /// </summary> |
| 40 | + public const string FirstName = "http://schemes.superoffice.net/identity/firstname"; |
| 41 | + |
| 42 | + /// <summary> |
| 43 | + /// SuperOffice identity provider name. |
| 44 | + /// </summary> |
| 45 | + public const string IdentityProvider = "http://schemes.superoffice.net/identity/identityprovider"; |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// Current user initials. |
| 49 | + /// </summary> |
| 50 | + public const string Initials = "http://schemes.superoffice.net/identity/initials"; |
| 51 | + |
| 52 | + /// <summary> |
| 53 | + /// Determines if current user is an administrator. |
| 54 | + /// </summary> |
| 55 | + public const string IsAdministrator = "http://schemes.superoffice.net/identity/is_administrator"; |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// Current user last name. |
| 59 | + /// </summary> |
| 60 | + public const string LastName = "http://schemes.superoffice.net/identity/lastname"; |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// Endpoint of SuperOffice SOAP web services. |
| 64 | + /// </summary> |
| 65 | + public const string NetServerUrl = "http://schemes.superoffice.net/identity/netserver_url"; |
| 66 | + |
| 67 | + /// <summary> |
| 68 | + /// Tenant database serial number. |
| 69 | + /// </summary> |
| 70 | + public const string Serial = "http://schemes.superoffice.net/identity/serial"; |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// Current user's tenant primary email address. |
| 74 | + /// </summary> |
| 75 | + public const string PrimaryEmail = "http://schemes.superoffice.net/identity/so_primary_email_address"; |
| 76 | + |
| 77 | + /// <summary> |
| 78 | + /// Identifier used to exchange for a system user ticket. |
| 79 | + /// </summary> |
| 80 | + public const string SystemToken = "http://schemes.superoffice.net/identity/system_token"; |
| 81 | + |
| 82 | + /// <summary> |
| 83 | + /// Credentials token used to access web services. |
| 84 | + /// </summary> |
| 85 | + public const string Ticket = "http://schemes.superoffice.net/identity/ticket"; |
| 86 | + |
| 87 | + /// <summary> |
| 88 | + /// Current user's username. |
| 89 | + /// </summary> |
| 90 | + public const string UserPrincipalName = "http://schemes.superoffice.net/identity/upn"; |
| 91 | + |
| 92 | + /// <summary> |
| 93 | + /// Endpoint of SuperOffice REST web services. |
| 94 | + /// </summary> |
| 95 | + public const string WebApiUrl = "http://schemes.superoffice.net/identity/webapi_url"; |
| 96 | + } |
| 97 | + |
| 98 | + internal static class FormatStrings |
| 99 | + { |
| 100 | + /// <summary> |
| 101 | + /// A format string used to construct <see cref="SuperOfficeAuthenticationOptions.Authority"/>. |
| 102 | + /// </summary> |
| 103 | + public const string Authority = "https://{0}.superoffice.com/login"; |
| 104 | + |
| 105 | + /// <summary> |
| 106 | + /// A format string used to populate OAuth authorize endpoint. |
| 107 | + /// </summary> |
| 108 | + public const string AuthorizeEndpoint = "https://{0}.superoffice.com/login/common/oauth/authorize"; |
| 109 | + |
| 110 | + /// <summary> |
| 111 | + /// A format string used to construct <see cref="AuthenticationSchemeOptions.ClaimsIssuer"/>. |
| 112 | + /// </summary> |
| 113 | + public const string ClaimsIssuer = "https://{0}.superoffice.com"; |
| 114 | + |
| 115 | + /// <summary> |
| 116 | + /// A format string used to construct well-known configuration endpoint. |
| 117 | + /// </summary> |
| 118 | + public const string MetadataEndpoint = "https://{0}.superoffice.com/login/.well-known/openid-configuration"; |
| 119 | + |
| 120 | + /// <summary> |
| 121 | + /// A format string used to populate OAuth token endpoint. |
| 122 | + /// </summary> |
| 123 | + public const string TokenEndpoint = "https://{0}.superoffice.com/login/common/oauth/tokens"; |
| 124 | + |
| 125 | + /// <summary> |
| 126 | + /// A format string used to obtain user claims. |
| 127 | + /// </summary> |
| 128 | + /// <remarks>The final user information URL contains the protocol, host and tenant.</remarks> |
| 129 | + /// <example>https://sod.superoffice.com/Cust12345/api/v1/user/currentPrincipal</example> |
| 130 | + public const string UserInfoEndpoint = "/{0}/api/v1/user/currentPrincipal"; |
| 131 | + } |
| 132 | + |
| 133 | + public static class PrincipalNames |
| 134 | + { |
| 135 | + /// <summary> |
| 136 | + /// Associate name (e.g. logon name) for the current user. |
| 137 | + /// </summary> |
| 138 | + public const string Associate = "Associate"; |
| 139 | + |
| 140 | + /// <summary> |
| 141 | + /// Associate ID for the current user. |
| 142 | + /// </summary> |
| 143 | + public const string AssociateId = "AssociateId"; |
| 144 | + |
| 145 | + /// <summary> |
| 146 | + /// Business ID for the company that the user belongs to. |
| 147 | + /// </summary> |
| 148 | + public const string BusinessId = "BusinessId"; |
| 149 | + |
| 150 | + /// <summary> |
| 151 | + /// Category ID of the company that the user belongs to. |
| 152 | + /// </summary> |
| 153 | + public const string CategoryId = "CategoryId"; |
| 154 | + |
| 155 | + /// <summary> |
| 156 | + /// Company of the associate's person. |
| 157 | + /// </summary> |
| 158 | + public const string ContactId = "ContactId"; |
| 159 | + |
| 160 | + /// <summary> |
| 161 | + /// Owner (AssociateId) of the company that the user belongs to. |
| 162 | + /// </summary> |
| 163 | + public const string ContactOwner = "ContactOwner"; |
| 164 | + |
| 165 | + /// <summary> |
| 166 | + /// Name of the tenant context identifier. |
| 167 | + /// </summary> |
| 168 | + public const string ContextIdentifier = "ContextIdentifier"; |
| 169 | + |
| 170 | + /// <summary> |
| 171 | + /// Country ID for the user. |
| 172 | + /// </summary> |
| 173 | + public const string CountryId = "CountryId"; |
| 174 | + |
| 175 | + /// <summary> |
| 176 | + /// Name of the database context. |
| 177 | + /// </summary> |
| 178 | + public const string DatabaseContextIdentifier = "DatabaseContextIdentifier"; |
| 179 | + |
| 180 | + /// <summary> |
| 181 | + /// Service user access level. |
| 182 | + /// </summary> |
| 183 | + public const string EjAccessLevel = "EjAccessLevel"; |
| 184 | + |
| 185 | + /// <summary> |
| 186 | + /// Primary key in Service user table. |
| 187 | + /// </summary> |
| 188 | + public const string EjUserId = "EjUserId"; |
| 189 | + |
| 190 | + /// <summary> |
| 191 | + /// Service user status. |
| 192 | + /// </summary> |
| 193 | + public const string EjUserStatus = "EjUserStatus"; |
| 194 | + |
| 195 | + /// <summary> |
| 196 | + /// The Person e-mail address if the associate is a person. Use IsPerson to check. |
| 197 | + /// </summary> |
| 198 | + public const string EmailAddress = "EMailAddress"; |
| 199 | + |
| 200 | + /// <summary> |
| 201 | + /// The Person full name if the associate is a person. Use IsPerson to check. |
| 202 | + /// </summary> |
| 203 | + public const string FullName = "FullName"; |
| 204 | + |
| 205 | + /// <summary> |
| 206 | + /// Functional rights for the user. This array is sorted. |
| 207 | + /// </summary> |
| 208 | + public const string FunctionRights = "FunctionRights"; |
| 209 | + |
| 210 | + /// <summary> |
| 211 | + /// Associate's group ID. |
| 212 | + /// </summary> |
| 213 | + public const string GroupId = "GroupId"; |
| 214 | + |
| 215 | + /// <summary> |
| 216 | + /// Country ID for the user's home country. This is the default country ID when creating new items. |
| 217 | + /// </summary> |
| 218 | + public const string HomeCountryId = "HomeCountryId"; |
| 219 | + |
| 220 | + /// <summary> |
| 221 | + /// Is this associate a person, and not a resource? |
| 222 | + /// </summary> |
| 223 | + public const string IsPerson = "IsPerson"; |
| 224 | + |
| 225 | + /// <summary> |
| 226 | + /// Licenses granted to the site and user. |
| 227 | + /// </summary> |
| 228 | + public const string Licenses = "Licenses"; |
| 229 | + |
| 230 | + /// <summary> |
| 231 | + /// Associate's person ID. |
| 232 | + /// </summary> |
| 233 | + public const string PersonId = "PersonId"; |
| 234 | + |
| 235 | + /// <summary> |
| 236 | + /// The credentials used for authenticating this user. |
| 237 | + /// </summary> |
| 238 | + public const string ProvidedCredentials = "ProvidedCredentials"; |
| 239 | + |
| 240 | + /// <summary> |
| 241 | + /// Description (e.g. tooltip) for the user's role. |
| 242 | + /// </summary> |
| 243 | + public const string RoleDescription = "RoleDescription"; |
| 244 | + |
| 245 | + /// <summary> |
| 246 | + /// ID of the user's role. |
| 247 | + /// </summary> |
| 248 | + public const string RoleId = "RoleId"; |
| 249 | + |
| 250 | + /// <summary> |
| 251 | + /// Name of the user's role. |
| 252 | + /// </summary> |
| 253 | + public const string RoleName = "RoleName"; |
| 254 | + |
| 255 | + /// <summary> |
| 256 | + /// Type of user. |
| 257 | + /// </summary> |
| 258 | + public const string RoleType = "RoleType"; |
| 259 | + |
| 260 | + /// <summary> |
| 261 | + /// Secondary user groups. |
| 262 | + /// </summary> |
| 263 | + public const string SecondaryGroups = "SecondaryGroups"; |
| 264 | + |
| 265 | + /// <summary> |
| 266 | + /// Type of user. |
| 267 | + /// </summary> |
| 268 | + public const string UserType = "UserType"; |
| 269 | + } |
| 270 | + } |
| 271 | +} |
0 commit comments