Nueva publicación

Encontrar

Pregunta
· 30 ene, 2025

Intercepting JWT Token in Cookies Instead of Authorization Header in Web Application

I am building a web application that uses JWT for authentication. I would like to pass the token in cookies instead of the Authorization header.
Is there a way to intercept the request and check the token from the cookies instead of the header? I tried overriding the OnPreDispatch() method and adding it to my dispatch class, but it seems like it never gets executed, as the response returns "Unauthorized" before reaching it.

ClassMethod OnPreDispatch(pURL As %String, pMethod As %String, ByRef pContinue As %Boolean) As %Status
{
        Set token = %request.Cookies.Get("JWT-TOKEN")
        
        If token = "" {
            Set pContinue = 0
            Quit $$$ERROR($$$GeneralError, "Unauthorized: Token not found in cookie")
        }
        
        Do %request.SetCgiEnv("HTTP_AUTHORIZATION", "Bearer "_token)
        
        Set pContinue = 1
        Quit $$$OK
}
2 comentarios
Comentarios (2)3
Inicie sesión o regístrese para continuar
Pregunta
· 30 ene, 2025

How can I correctly add the OBXgrp(1).OBX segment to an HL7 message?

Hello,

I'm trying to add another segment to an HL7 MDM message. More specifically OBXgrp(1).OBX. The addition itself works,. When I look at the message in the trace, the segment with the content can be seen. However, it is not displayed as an OBX segment.

 

Build Map Status = 'ERROR <EnsEDI>ErrMapRequired: Missing required OBXgrp(1) element at segment 6'
'ERROR <EnsEDI>ErrMapSegUnrecog: Unrecognized Segment 6:'' found after segment 5 (TXA)'


// HL7-Nachricht klonen
    Set response = msg.%ConstructClone()

// OBX-Segment erstellen
    Set tSegmentOBX = ##class(EnsLib.HL7.Segment).%New()
    Set tSegmentOBX.SegType = "2.7:OBXgrp(1).OBX"
    
   .
   .
   .
   Set tSC = tSegmentOBX.SetValueAt("bla", 3, "set")
   .
   .
   // OBX-Segment an Position 6 einfügen
    Set tSC = response.InsertSegmentAt(tSegmentOBX, 6)
    If $$$ISERR(tSC) {
        Return $$$ERROR($$$GeneralError, "Fehler beim Einfügen des OBX-Segments an Position 6.")
    }
    .
    .
    .
    Set status = ..SendRequestAsync(target, response)
    .
    .

What do I need to change or adjust so that the segment appears correctly in the message?

 

 

Many thanks in advance 

2 comentarios
Comentarios (2)2
Inicie sesión o regístrese para continuar
Pregunta
· 30 ene, 2025

Retrieving Bucket list from S3

Hi Guys,

I'm looking for sample code to connect to S3 and retrieve and backet data? 

Thanks

1 Comentario
Comentarios (1)2
Inicie sesión o regístrese para continuar
Pregunta
· 30 ene, 2025

create a listen server in Cache 2016

Hi everyone,
I am trying to create a listen server in Cache 2016 that can capture data from a specific port. Can someone guide me on how to set this up, including handling incoming connections and reading data from the port? Any advice or example code would be much appreciated!

Thanks in advance!

2 comentarios
Comentarios (2)2
Inicie sesión o regístrese para continuar
Resumen
· 29 ene, 2025

2024 年の InterSystems コミュニティ年間ニュースレター

こんにちは。2024 年の年間開発者コミュニティニュースレターへようこそ。
全体統計:
228 件の投稿が公開 (2024 年):
 146件の記事
 74件の発表
 7件の質問
  – 1件のディスカッション
75 人のメンバーが開発者コミュニティに参加 (2024 年)
✓ 合計 1,432 件の投稿が公開 (全期間)
✓ 合計 17,543 人のメンバーが参加 (全期間)
最も人気:
887
Megumi Kakechi順
531
Megumi Kakechi順
最も議論されている
最もいいねが多い
最も人気の作成者
最も記事の多い作成者
2024 年の概要インターシステムズ開発者コミュニティ