Articles

Affichage des articles associés au libellé ibm app id

Using IBM App ID roles with Spring Security

Image
This is something I've been meaning to write for a long time. If you're already familiar with how to set up App ID in a Spring Boot application, feel free to skip to the fifth step. That's where the juicy parts are. 1. Creating a project Let's start off by creating a new Spring Boot project. This link contains a Spring Boot project with the required dependencies: Spring Security, Spring Web and OAuth2 resource server. 2. Configuring App ID Next, let's create service credentials in our App ID instance. Notice that we gave it write permissions. You'll see why soon. While we're here, let's also add the "http://localhost:8080/login" redirect URL in the authentication settings : To make things easier, let's enable the Google provider in the "Identity Providers" tab. This way we can log in with an existing Google account. If you don't want to do this, it's also possible to create an account on Cloud Directo...

Decoding JWTs in the terminal

Image
These past few days, I have been working on integrating IBM App ID into our Java backend and Android frontend codebases. Because of this, I would find myself going back and forth between the terminal and JWT.io whenever I need to inspect a JWT's payload. I don't want to call it a "JWT token" because that would be a bad case of RAS and I'm pedantic like that, but I digress. Instead of relying on a website to do that for me, I figured why not just do it from the terminal. I did some reading and it turns out that JWTs are relatively easy to parse : Split the token using the dot character as a delimiter Base 64 decode the first portion to get the header Base 64 decode the second portion to get the payload The third portion serves as a signing mechanism for the token. I chose to ignore the signing logic for the script I intended to write because it was irrelevant for my use case. I ended up writing a command line tool in D to help me inspect JWTs. The ma...