{"action":"created","issue":{"url":"https://api.github.com/repos/KentorIT/authservices/issues/335","labels_url":"https://api.github.com/repos/KentorIT/authservices/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/KentorIT/authservices/issues/335/comments","events_url":"https://api.github.com/repos/KentorIT/authservices/issues/335/events","html_url":"https://github.com/KentorIT/authservices/issues/335","id":118052023,"number":335,"title":"Is it possible to provide certificates via code?","user":{"login":"dariusdamalakas","id":131102,"avatar_url":"https://avatars.githubusercontent.com/u/131102?v=3","gravatar_id":"","url":"https://api.github.com/users/dariusdamalakas","html_url":"https://github.com/dariusdamalakas","followers_url":"https://api.github.com/users/dariusdamalakas/followers","following_url":"https://api.github.com/users/dariusdamalakas/following{/other_user}","gists_url":"https://api.github.com/users/dariusdamalakas/gists{/gist_id}","starred_url":"https://api.github.com/users/dariusdamalakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dariusdamalakas/subscriptions","organizations_url":"https://api.github.com/users/dariusdamalakas/orgs","repos_url":"https://api.github.com/users/dariusdamalakas/repos","events_url":"https://api.github.com/users/dariusdamalakas/events{/privacy}","received_events_url":"https://api.github.com/users/dariusdamalakas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-20T14:29:03Z","updated_at":"2015-11-21T00:06:36Z","closed_at":null,"body":"We use `KentorAuthServicesSection` to configure IdP in `app.config`. However, we want to load `serviceCertificate` manually via code (we have a custom`ICertificateStore` implementation).  If we omit `serviceCertificate` element, then it fails with a certificate required exception.\r\n\r\nIs there any way we can provider certificates via code?\r\n\r\nhttps://github.com/KentorIT/authservices/blob/master/Kentor.AuthServices/Configuration/KentorAuthServicesSection.cs#L326\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/KentorIT/authservices/issues/comments/158563574","html_url":"https://github.com/KentorIT/authservices/issues/335#issuecomment-158563574","issue_url":"https://api.github.com/repos/KentorIT/authservices/issues/335","id":158563574,"user":{"login":"explunit","id":2872623,"avatar_url":"https://avatars.githubusercontent.com/u/2872623?v=3","gravatar_id":"","url":"https://api.github.com/users/explunit","html_url":"https://github.com/explunit","followers_url":"https://api.github.com/users/explunit/followers","following_url":"https://api.github.com/users/explunit/following{/other_user}","gists_url":"https://api.github.com/users/explunit/gists{/gist_id}","starred_url":"https://api.github.com/users/explunit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/explunit/subscriptions","organizations_url":"https://api.github.com/users/explunit/orgs","repos_url":"https://api.github.com/users/explunit/repos","events_url":"https://api.github.com/users/explunit/events{/privacy}","received_events_url":"https://api.github.com/users/explunit/received_events","type":"User","site_admin":false},"created_at":"2015-11-21T00:06:36Z","updated_at":"2015-11-21T00:06:36Z","body":"Not sure if this helps in your situation, but in my case I am constructing the `SPOptions` purely through code and not using the configuration sections.\r\n```\r\n\t\t\tvar serviceProviderOptions = new SPOptions\r\n\t\t\t{\r\n\t\t\t\tEntityId = new EntityId( myConfig.EntityId ),\r\n\t\t\t\tMetadataCacheDuration = TimeSpan.FromSeconds( myConfig.MetadataCacheSeconds ),\r\n\t\t\t\tReturnUrl = new Uri( myConfig.ReturnUrl ),\r\n\t\t\t\tServiceCertificate = myLoadedCert\r\n\t\t\t};\r\n      // add identity providers etc ...\r\n```\r\nThe ServiceCertificate property is marked as get/set. Are you saying that you cannot leave it empty in the config and set it later? What is the exact error message?"}}