pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masih Tavassoli <mtavasso@yahoo.co.uk>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: JWT decoder
Date: Mon, 9 Aug 2021 02:16:12 +0000 (UTC)
Message-ID: <2138331050.291272.1628475372080@mail.yahoo.com> (raw)
References: <2138331050.291272.1628475372080.ref@mail.yahoo.com>

Hi experts,
I am trying to find a way to decode a URL request header and extract its JSON fields in postgreql .
I can do this in Oracle sql using 

select    (utl_raw.cast_to_varchar2 (utl_encode.base64_decode( utl_raw.cast_to_raw (regexp_replace ( ( 'eyJhbGciOiJSUzI1NiIsImtpZCI6InBhLWFwaS1zaWduIn0.eyJzY29wZSI6W10sInN1YiI6Imp1bGllQHNhcHBoaXJlY29udmV5YW5jaW5nLm5ldC5hdSIsImNsaWVudCI6InB4YV9hY19zZXR0c3BsdXMiLCJ1c2VybmFtZSI6Imp1bGllQHNhcHBoaXJlY29udmV5YW5jaW5nLm5ldC5hdSIsImV4cCI6MTU1NDA4NzU2N30.OZwVETCP+HUDsSkudCfa52eQT2Fyt6BgefFpYr5xpJROjZJeVnXtzsU6MS8aHauqyyOwQSz8iG6OC2YjYgrGiZ8YTwTh1uHptNjicyCFmCkh++d0oGdK78ZOKIAvuslW3GX4V13hPUJADzGLkyO8hy01YF9Id4+7GrvmnRRkwPO7C2eUvKTB8pxDAA94Jpw74s4BiNTmm1Uv+56AXqdI8m2KFkLNwGoUR3OSNvsifl5uxBsGGmP4wbgNe/Dy1q2UsL2eBAW/GuWryHGCRz1/PR2jIV1v21ClQ8YLiFAzM3YxHb8m2ngzRynKof+Nw3nZvuafRQ16MV5THz0ahGFYLA'
), '[[:space:]]', ''))))) from dual


But there doesn't seem to be a way doing it in postgres.
Has anyone got any suggesions?
ThanksMasih

view thread (7+ messages)  latest in thread

Message-ID: <2138331050.291272.1628475372080@mail.yahoo.com>
Permalink:  ../2138331050.291272.1628475372080@mail.yahoo.com/
Also on:    postgresql.org/message-id/2138331050.291272.1628475372080@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: mtavasso@yahoo.co.uk
  Subject: Re: JWT decoder
  In-Reply-To: <2138331050.291272.1628475372080@mail.yahoo.com>
  References: <2138331050.291272.1628475372080.ref@mail.yahoo.com> <2138331050.291272.1628475372080@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox