Problems with application authorization
AuthorizeErrorCode
Problems with tokens and certificate
Error: ID4037
The key needed to verify the signature could not be resolved from the following security key identifier ‘SecurityKeyIdentifier’.
- the certificates are not installed on the local machine, or
- the certificates are not configured to load the SuperOfficeFederatedLogin.crt certificate by using the
CertificateFileCertificateStoreTokenResolverclass
- Check the online certificates are installed on the local machine.
- Use the
CertificateFileCertificateStoreTokenResolverto point to the location of the SuperOfficeFederatedLogin.crt certificate. Set theCertificateValidatorto X509.CertificateValidator.None.
Error: ID4175
The issuer of the security token was not recognized by the IssuerNameRegistry.
- Install the correct certificates for the correct environment (SOD, Stage, Production) into the local certificate store.
- Make sure the thumbprint is correct: use the arrow keys or Backspace to verify that there is no hidden character before the thumbprint value.
IssuerTokenResolver and set the CertificateValidator to X509CertificateValidator.None.
Error: ID4148
The Saml2SecurityToken is rejected because the SAML2:Assertion’s NotOnOrAfter condition is not satisfied.
Error: Data at the root level is invalid. Line 1, position 1
Problem: TokenHandler attempted to validate a JWT token with the SAML token enumeration. Resolution: Change the enumeration from SAML to JWT.Error: IDX10708
System.IdentityModel.Tokens.JwtSecurityTokenHandler cannot read this string:
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idX...shortened for brevity...W9uIElEPSJfZWQ4O- Don’t set the
tokenHandler.JwtIssuerSigningCertificateproperty if you use locally installed certificates. - Don’t set
tokenHandler.IssuerTokenResolverto a newCertificateFileCertificateStoreTokenResolverinstance if you use a relative certificate file. - Change the
TokenTypeenumeration from Jwt to SAML in theValidatemethod.
Error: Value cannot be null. Parameter name: certificate
Possible problem 1: TokenHandler attempted to validate a SAML token with the Jwt token enumeration. Resolution 1: Change the enumeration from Jwt to SAML.Exception:Failed validating token at at SuperOffice.SuperID.Client.Tokens.SuperIdTokenHandler.ValidateJwtToken(String token, ClaimsPrincipal& claimsPrincipal) in …at SuperOffice.Online.Mirroring.MirroringClientService.ValidateSuperOfficeSignedToken(String token) in …at SuperOffice.Online.Mirroring.MirroringClientService.Authenticate(AuthenticateRequest request) in …Value cannot be null. Parameter name: certificate at at Microsoft.IdentityModel.Tokens.X509SecurityKey..ctor(X509Certificate2 certificate) in …
Error: Cannot locate PartnerHttpContext
Problem: The web application web.config file declared a session mode equal toPartnerHttpContext, but that class is not included in the project or an assembly located in the website’s bin folder.
Resolution:
Ensure your web project contains the following files from the sample project SuperOffice.DevNet.Online.Login:
- ContextInitializer.cs
- ContextResolver.cs
- PartnerHttpContext.cs