innofactor / innofactor.suomifiidentificationclient Goto Github PK
View Code? Open in Web Editor NEWSuomi.fi e-identification client library for .NET
License: GNU Lesser General Public License v3.0
Suomi.fi e-identification client library for .NET
License: GNU Lesser General Public License v3.0
When I add this registration:
services.AddScoped<ICertificateStore, RsaShaCrypto>();
the compiler complains and shows error:
Error CS0311 The type 'Innofactor.SuomiFiIdentificationClient.Support.RsaShaCrypto' cannot be used as type parameter 'TImplementation' in the generic type or method 'ServiceCollectionServiceExtensions.AddScoped<TService, TImplementation>(IServiceCollection)'. There is no implicit reference conversion from 'Innofactor.SuomiFiIdentificationClient.Support.RsaShaCrypto' to 'Innofactor.SuomiFiIdentificationClient.Support.ICertificateStore'
Suprising behavior in EncryptedCookieStorage
It seems the EncryptedCookieStorage type always reads the cookie from the network request object while setting the cookie goes to response object.
Could this behavior be altered so that response object is always checked first , if the backend service has already set new cookie information and reads it back during the same routine, it finds the already updated object instead of the old one.
I ran into an issue when running the library that AesGcmDecryptorDispose()
is called and it has no implementation so it causes the identification to crash. This might be a net7.0 issue. Perhaps the earlier frameworks don't call it.
I made a fork from the release and tested by adding an empty implementation to the function:
public void Dispose() { }
This works and suomi.fi identication works with this change but it would be helpful to have the "fix" in the official release. As far as I can tell, the Dispose function doesn't have any cleanup to do as the class members are initialized in the constructor and would be freed when the object is no longer needed. And other objects taking memory are used in the TransformFinalBlock() function as local variables so they should be freed when the function exits. So, therefore an empty implementation of Dispose() should be enough?
I ran into a problem where the redirect URL to suomi.fi would have a lot of A/ 0:s at the end. After investigating the issue, I noticed that the Serialize function in Saml2HttpRedirect produces the extra As at the end. I tested the function with the proper XML output from suomi.fi and also with various strings. The behavior on all of them is the same.
For example, call Serialize("Hello")
produces the following output:
8kjNyckHAAAA%2F%2F8DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%3D%3D
And further investigation, the culprit seems to be the compressed.GetBuffer()
call. Replacing GetBuffer()
with ToArray()
seems to fix the problem. Call Serialize("Hello")
produces then:
8kjNyckHAAAA%2F%2F8DAA%3D%3D
And that output seems correct. My program is running on dotnet 7.0 so perhaps it's simply something caused by the version. Do you have any ideas what might be causing the problem and do you think changing the GetBuffer()
call to ToArray()
is a sufficient workaround?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.