Question Stephen Wilson · Mar 11, 2020 Can you have a custom %Status object without the error code in the $SYSTEM.Status.GetErrorText(sc) output ? There does not seem to be any separation between the error code and error text in a %Status object. For custom errors, I simply want to display the message and not Error #5001: Some error text. #.NET #Error Handling #ObjectScript #Caché 0 5 0 429
Question Stephen Wilson · Feb 4, 2020 Caché Studio : How to find and record all global variables referenced in routine or collection of routines? I am looking to run some analysis on existing software to quickly identify global variable references. Ideally you would feed in a "starting routine" and after going through all referenced routines you would end up with a finite set of global variables. So the primary purpose is to take say 10,000 lines of code and map out the referenced global structures without relying on a programmers eye. I found the post on Object Script equivalent to Studio "Find in Files" interesting but the downside is that output is too verbose and would require parsing to extract the global structures. How would you override writing to the terminal so that you could parse the data? #ObjectScript #Caché 0 4 0 587
Question Stephen Wilson · Sep 20, 2019 Is there an OAuth 2.0 "sliding expiration" for JWT access tokens to extend the expiry date? In .NET Core you have an option to extend a session using a "sliding expiration". This means that if over half the time has passed and the user actively uses their session then the expiry timer gets reset and the user remains logged in. This can lead to the curious situation where you have an active authenticated user with an expired access token being used in data-access requests. #.NET #OAuth2 #Frontend #Caché 0 1 0 2,930
Question Stephen Wilson · Aug 21, 2019 ASP .NET Core Identity (v3) uses PBKDF2 algorithm with HMAC-SHA256, 128-bit salt, 256-bit subkey, and 10,000 iterations. What does Caché use? The .NET Core Identity model has an IPasswordHasher<> interface for for Hashing a password so that it can be stored in a databaseVerifying a provided plain-text password matches a previously stored hash. I am getting invalid password errors during the login process when the .NET Core Identity model computes a hash from a plain text input and compares it to a password hash value I've returned from Caché. The default hashing algorithm is PBKDF2 with HMAC-SHA256, 128-bit salt, 256-bit subkey, and 10,000 iterations (detailed article on .NET Core Identity PasswordHasher). The algorithm Caché uses is probably different which may be why I am getting errors. #.NET #ObjectScript #Security #Caché 0 6 1 1,698
Question Stephen Wilson · Aug 13, 2019 Adding custom claims to in OAuth 2.0? I have an OAuth 2.0 development environment where Caché is serving all three roles as the Authorization Server, Client and Resource Server based on a great 3-part series on OAuth 2.0 by @Daniel Kutac. I have a simple password grant type where an x-www-form-urlencoded body (as described in this post) is sent as a POST to the token endpoint at https://localhost:57773/oauth2/token and a response body with a HTTP Response 200 header is returned. The response body looks something like this. #OAuth2 #ObjectScript #Caché 2 3 0 1,831
Question Stephen Wilson · Oct 10, 2018 Has anyone used .NET Core EF with Caché? What would a sample DbContext look like and how would you register the DbContext in the Startup.cs ConfigureServices method? #Beginner #Caché #Data Model #.NET 1 6 0 948
Question Stephen Wilson · Oct 8, 2018 Can you perform Kills or Sets directly on globals within .NET without ObjectScript classes or generated proxy classes ? I think I already know the answer to this but I thought I'd ask anyway. So the Node.js adapter allows you to perform operations directly on Globals. Does the InterSystems.Data.CacheClient.dll or InterSystems.CacheExtreme.dll provide a mechanism to access Gobals directly or are you accessing globals via Caché ObjectScript classes? #Beginner #Object Data Model #Caché 0 5 0 412
Question Stephen Wilson · Oct 4, 2018 Cache Objects -How to check for a null property when reading an object? You have a global ^CODE("TNO","BIO",291,"AKI") that may or may not exist. On the data side of the global ref it can have a boolean value of 0 (false) or 1 (true) and this global is wrapped up in a Caché class accessible from myobject.AKI property. At the object level, how do you check whether the property is defined ie. is there a $DATA equivalent for Cache Object properties? Also, how would you kill /null the property as opposed to making the value 0 (false) or an empty string? #Beginner #Object Data Model #Caché 0 10 0 2,537
Question Stephen Wilson · Sep 19, 2018 How to pass JSON body as part of a HTTP Status 404 Response message 404 Not Found { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Not Found" } ], "code": 404, "message": "Not Found" } } I want to do something like the above sample from a Google Storage JSON API. I have a call to Write obj.%ToJSON() followed by return ..ReportHttpStatusCode(..#HTTP404NOTFOUND) however the HTTP Status code is always 200. If I remove the Write obj.%ToJSON() statement it returns a 404 status with no body. How do I return both? #JSON #Object Data Model #REST API #Frontend #SOAP #Caché 0 1 0 2,067
Question Stephen Wilson · Sep 14, 2018 How do I process queryString parameters in a HttpGet Request in a %CSP.REST page? So by queryString I mean name-value pairs passed in as part of the URL. Currently my service works when called like this #Object Data Model #REST API #SOAP #Caché 0 2 0 413