dozieokk
dozieokk
WWasp
Created by dozieokk on 12/4/2024 in #đŸ™‹questions
Bluesky oauth
Has anyone setup Bluesky Oaoth yet I'm looking through https://discord.com/channels/686873244791210014/1260809637603708979 and can see Riot Games was integrated, but any tips would be helpful
9 replies
WWasp
Created by dozieokk on 12/1/2024 in #đŸ™‹questions
how to pass through a json response from the server to the client without using react component
how do I pass through a json response from the server to the client without using react component. Example: if client is hosted on port 3000 at client.com, and I have an api endpoint hosted on port 3001 which the client is using API:
api getOauthClientMetadata {
fn: import { getOauthClientMetadata } from "@src/server/getOauthClientMetadata.ts",
httpRoute: (GET, "/oauth/client-metadata.json")
}
api getOauthClientMetadata {
fn: import { getOauthClientMetadata } from "@src/server/getOauthClientMetadata.ts",
httpRoute: (GET, "/oauth/client-metadata.json")
}
The API returns the following json:
import { Request, Response } from 'express';

export const getOauthClientMetadata = async (_req: Request, res: Response) => {
res.setHeader('Content-Type', 'application/json');
res.status(200).json({
application_type: "web",
client_id: "https://oauth-flask.demo.bsky.dev/oauth/client-metadata.json",
client_name: "atproto OAuth Flask Backend Demo",
client_uri: "https://oauth-flask.demo.bsky.dev/",
dpop_bound_access_tokens: true,
grant_types: [
"authorization_code",
"refresh_token"
],
jwks_uri: "https://oauth-flask.demo.bsky.dev/oauth/jwks.json",
redirect_uris: [
"https://oauth-flask.demo.bsky.dev/oauth/callback"
],
response_types: [
"code"
],
scope: "atproto transition:generic",
token_endpoint_auth_method: "private_key_jwt",
token_endpoint_auth_signing_alg: "ES256"
});
};
import { Request, Response } from 'express';

export const getOauthClientMetadata = async (_req: Request, res: Response) => {
res.setHeader('Content-Type', 'application/json');
res.status(200).json({
application_type: "web",
client_id: "https://oauth-flask.demo.bsky.dev/oauth/client-metadata.json",
client_name: "atproto OAuth Flask Backend Demo",
client_uri: "https://oauth-flask.demo.bsky.dev/",
dpop_bound_access_tokens: true,
grant_types: [
"authorization_code",
"refresh_token"
],
jwks_uri: "https://oauth-flask.demo.bsky.dev/oauth/jwks.json",
redirect_uris: [
"https://oauth-flask.demo.bsky.dev/oauth/callback"
],
response_types: [
"code"
],
scope: "atproto transition:generic",
token_endpoint_auth_method: "private_key_jwt",
token_endpoint_auth_signing_alg: "ES256"
});
};
how do I access the json from client.com/oauth/client-metadata.json as json
13 replies