error message :
{ "ResultMessage": "Unexpected error while signing the token: Key type is not supported, please provide a JSON Web Key using a RSA algorithm"}
but i'm using the rsa algorithm generated by mkjwk :
{
"jwt_payload":{
"TokenId":"1",
"Issuer":"myapp",
"Subject":"1",
"Audience":"ppl",
"Expires":"2014-12-31T23:59:59.938Z",
"NotBefore":"2014-12-31T23:59:59.938Z",
"IssuedAt":"2014-12-31T23:59:59.938Z",
"Claims":[
"Name":"test",
"Value":"test",
"IsJsonEncoded":false
}
]
},
"sign":{
"p":"vXCZoT3u7vULbMNlN3u42axmv_Dr6OgMKtVTmKcP__55-Bkfh0pYj45r3ET3YlHe8YH3v6GMmCaJ0fnEETg-aan3KbaxafjKugMqX0qnB9zuiAa4WC0QICMYjgZBJrm3SNOKHI-hIkikOSsnOCacDgBhhiGivL5pIzgvtUXho7M",
"kty":"RSA",
"q":"uBTVqynwFEhU-BbbsQmQaQh-FFHhXvRDh2-S7hemQmZCysgIkI5E_24JOGI80X05Yg_b7tY9MVlNjolmZLT7cYPOHWHCgZ_CO_5mld2Zu7mSyTrFHXyq6yJAvCIB9uPCc82-IU5fTApohxjxjKdvpnFvUic56eCdVWH-Ck---CE",
"d":"cPhCZeZnPxTFtHkj84br1_Yxnj5RW1DekXNmZ8uDsoxbVXOENzOOCGGb844gEJpQUDG41TOPrS8ReAfkZHab_WtjoDTe8Qjr2xxYBRAvEBNbLUgtfhPo4nTXLkEowkA7mukDlZu6BNS_8HzLSUSib7WGIUGseHNNmuEj5i1w8Am7bItYpLUjKAgz3ZvpQFxGRMcyN6j1hmfOqZd3GWIb6sNZbNSYv5tlbvpDeuAsdJUrhZdjXQA-uZUZqqAnVFwayYlLgAeYkwOn6mOdf0b6SOwKBCc92y43kZexbk2tMmYbA-Oz1oAC-5c8TJFG5gO6ffirRivPjZlJHyGXaY8NwQ",
"e":"AQAB",
"use":"sig",
"kid":"uWD8vWSYwR3vW6VBOQxfgu2lQYQ=",
"qi":"RyHw0Qb6hU7GkaneMfJhtlJyta6eXeqoFhuUbAH_fDJPloW9ybyrcYl1nRly82y62uiDsQSMdOosMdsJKRP7pwMpeup190tYdUMw9skNvcmTnXhZ1aJw_SX2UR9D50ufTBPzdObK4c42ZClN91kYp5xvhzXTDKH5vwQkeLUIgtY",
"dp":"Cu0nr0knMtknY4qRl_Wm38c11fRLZw-bRA0x2SgpoBZJaqnoS6FaIk2Qow_HRQB732ojpAXpWg0-_cFuMaAQ2X9YJivHZ9lVuAzesMhZgfaYO3hHwa43s-LSU77Amz8y9xxcZvFR1exirHl0taRkc9pJxbbC8Cf7YHCpL8dsEEk",
"alg":"RS256",
"dq":"Wq9468_HRFa19VpddIP_rp7ObfhAjOTM98XRnpXsBD4YnYmaHozYFPYCeNJ8n7-PK24grTLCBrO174hk9yvpy2xheDwW9IDd0Wxs4VvARqkPVS8suHAYS6oeNhCS4ywlOaOcDRBtBisCf7ucE-zQpjCv5MsKTtum5s9VtYK_08E",
"n":"iDhZVT4vCtQjaDv9eoAVjFtwvSiHW5u4jIWPQ5qivpmkytAEMgU76s2BGvTXBUgmOGibd3vM46TTEN0rrbzYXUuUMVh5xm6lILGkmhjvnVzPOssfgdnCIShxsrovxG5WtZjZwIOBQzjIwFibFftV6NqwukGZ8QyLF0Hkw0nAbgJVJlwcPE0sI3j4jUBaEaQVi9LiMCfDWP_Sh9nOu9qYPCRcgEdj033U0friI0C6aLf8bS6C5-Mp-d7TK2303yUPyNQMgMq9e2CQIFcJZWlW9TQn5ammai_K7zTgNSxSL2kniSMC9WfUc8IIp60clFSvmLGlah2lAyNin0AKVIWCEw"
and the action :CreateSignedAsymmetricTokenWithJsonWebKeyService
and exposing in the rest api the token passing the parametere data a structure whos containing payload structure and a structure holding the signature parametres
ps: im using postman because in the documontation of my api the attributes are empty even tho i filled them with data
Please help
thank you
Hi Feriel,
I fail to see how your question is OutSystems-related. Can you elaborate?
i'm exposing an api that generate normally a token , as i want to test it in postman i get that error
If you are exposing a REST API yourself, then you can debug the REST API to see what goes wrong? Also, increase the logging level of the REST API so you can check the integration logging.
thanks it s usefu but the error does not give much of details that would help me :
Id2ddb5e15-c302-41c6-bdfb-6da0c7dd0d69
Time of Log2023-09-29 14:03:35
Request Keyaf10a426-39c8-4189-b41c-0c787fa0e8c1
ModuleJWTAdvanced
TenantUsers
User
Session Idauci+//4IEC0c11aEqXdCQ==
ServerSM2I3-LTSZR4
Source
MessageKey type is not supported, please provide a JSON Web Key using a RSA algorithm
Environment InformationeSpaceVer: Id=3560, PubId=0, CompiledWith=11.23.0.40636RequestUrl: http://kg9uum015.outsystemscloud.com/JWTAdvanced/serviceapi/CreateSignedAsymmetricTokenWithJsonWebKeyService (Method: POST)AppDomain: /LM/W3SVC/18/ROOT/JWTAdvanced-29-133402189143773500FilePath: C:\OutSystems\Sandboxes\KG9UUM015\Platform Server\running\JWTAdvanced\ClientIp: 127.0.0.1Locale: en-USDateFormat: yyyy-MM-ddPID: 15816 ('w3wp', Started='9/12/2023 6:06:24 AM', Priv=414Mb, Virt=2115785Mb)TID: 50Thread Name:.NET: 4.0.30319.42000
StackKey type is not supported, please provide a JSON Web Key using a RSA algorithm at ssJWTAdvanced.RssExtensionJWT_Core.MssCreateToken(HeContext heContext, IRecord inParamSymmetricCredentials, IRecord inParamAsymmetricCredentials, IRecord inParamPayload, Boolean inParamShowDebugInformation, String& outParamResultMessage, String& outParamPlainToken, String& outParamEncodedToken) at ssJWTAdvanced.Actions.ActionCreateSignedAsymmetricTokenWithJsonWebKey(HeContext heContext, String inParamJWKPlain, String inParamTokenId, String inParamIssuer, String inParamSubject, String inParamAudience, DateTime inParamExpiration, DateTime inParamNotBefore, DateTime inParamIssuedAt, RLJWT_ClaimRecordList inParamClaims, Boolean& outParamSuccess, String& outParamResultMessage, String& outParamPlainToken, String& outParamSignedAndEncodedToken)
because i already provided an rsa key
It seems your problem is very specifically in the JWT Advanced Forge asset, action CreateSignedAsymmetricTokenWithJsonWebKey calling the CreateToken action from JWT Core. If you had cared to debug, you would already know this!
So the error message is "StackKey type is not supported, please provide a JSON Web Key using a RSA algorithm". I'm not sure what that means, I don't know the JWT Advanced asset, but apparently you provide it with the wrong input parameters.