V
V
Vanes Ri_Lax2020-01-24 12:12:58
C++ / C#
Vanes Ri_Lax, 2020-01-24 12:12:58

Who worked with ESIA and CryptoPro .NET SDK?

Hello!
Installed:
CryptoPro CSP 5.0 for Windows
CryptoPro .NET 1.0.7132.0 (NET-x64-rus.msi)
CryptoPro .NET SDK 1.0.7132.0 (NETSDK-x64- rus.msi
)
the input gets a string like:

fullname birthdate2020.01.24 08:48:17 +0100MICC01565f8ba7023-fa2b-4365-901b-e6062d4d2933

I need to sign this line to use it to form the URL.
As an example, I took:
cpdn.cryptopro.ru/default.asp?url=content/cpnet/ht...
Then I make base64 url ​​safe from bytes. It turns out a URL like: (I cut base64 for ease of viewing)
https://esia-portal1.test.gosuslugi.ru/aas/oauth2/ac?client_id=MICC01565&client_secret=MIIUjQYJKoZIhvcNAQcCoIIUfjCCFHoCAQExDjAMBggqhQMHAQECAgUAMAsGCSqGSIb3DQEHAaCCEKMwgggEMIIHsaADAgECAhEDTIvMesQM-oDpESJGsDMu_zAKBggqhQMHAQEDAjCCASgxIDAeBgkqhkiG9w0BCQEWEW9vYjUxQG1haWwub3JiLnJ1MRgwFgYFKoUDZAESDTEwNjU2MTIwMzI4OTIxGjAYBggqhQMDgQMBARIMMDA1NjEyMDQ1ODQwMQswCQYDVQQGEwJSVTEzMDEGA1UECAwqNTYg0J7RgNC10L3QsdGD0YDQs9GB0LrQsNGPINC-0LHQu9Cw0YHRgtGMMR0wGwYDVQQHDBTQsy4g0J7RgNC10L3QsdGD0YDQszExMC8GA1UECQwo0YPQuy4g0JzQsNGA0YjQsNC70LAg0JbRg9C60L7QstCwLCDQtC40MjEcMBoGA1UECgwT0JPQkdCj0JcgItCc0JjQkNCmIjEcMBoGA1UEAwwT0JPQkdCj0JcgItCc0JjQkNCmIjAeFw0xOTAzMTQwNjIyNTVaFw0yMDAzMTQwNjMyNTVaMIIBRzEgMB4GCSqGSIb3DQEJARYRb29iNTFAbWFpbC5vcmIucnUxGjAYBggqhQMDgQMBARIMMDA1NjEyMDQ1ODQwMRgwFgYFKoUDZAESDTdA5oHuDmvpS3Vy5mN6g2Xj&redirect_uri=https://pp.io/&scope=fullname+birthdate&response_type=code&state=57b9ae3d-52a1-4f49-8b48-87c5d8784167&access_type=offline&timestamp=2020.01.24+08:56:58++0100

When I click on this link, ESIA returns me:
error_description: ESIA-007005: The client is not authorized to request an access token using this method.
state: 57b9ae3d-52a1-4f49-8b48-87c5d8784167
error: unauthorized_client
Maybe I took the wrong example for the signature?
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Smittyperm, 2020-07-06
@Smittyperm

I understand that the answer to the author is no longer relevant, but I will leave a message for those who will google this error.
If everything worked for you, and then suddenly stopped, the first thing to do is check the validity period of the certificate with which you sign requests to the ESIA.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question