I am trying to make api calls to Confluence cloud by authenticating with jwt. In my descriptor file, I have opted for the read scope.
I am following this guide on how to generate the jwt token. In my code base, I have
require 'atlassian/jwt'
require 'json'
require 'httparty'
url = "https://my-domain.atlassian.net/wiki/rest/api/space/space_key"
issuer = 'my_issuer'
http_method = 'get'
shared_secret = 'shared_secret'
claim = Atlassian::Jwt.build_claims(issuer, url, http_method)
jwt = JWT.encode(claim, shared_secret)
response = HTTParty.get("https://my-domain.atlassian.net/wiki/rest/api/space/space_key", :headers => {'Content-Type' => 'application/json', authorization: jwt})
puts response
I get the error {“message”:“Current user not permitted to use Confluence”,“statusCode”:403} . I dont know what I am doing wrong. How do I fix this and authenticate properly with jwt token in ruby?