atproto_oauth 0.0.1 copy "atproto_oauth: ^0.0.1" to clipboard
atproto_oauth: ^0.0.1 copied to clipboard

Provides tools to handle OAuth for AT Protocol and Bluesky Social.

example/example.dart

// Copyright 2024 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

import 'package:atproto_oauth/atproto_oauth.dart';

Future<void> main() async {
  final metadata = await getClientMetadata(
    'https://atprotodart.com/oauth/bluesky/atprotodart/client-metadata.json',
  );

  final client = OAuthClient(metadata);

  final (url, ctx) = await client.authorize('shinyakato.dev');

  print(url);
  print(ctx);

  //! Make user visit url.
  //! Then, once it was redirected to the callback URI, perform the following:

  final session = await client.callback(
    'https://atprotodart.com/oauth/bluesky/auth.html?iss=xxxx&state=xxxxxxx&code=xxxxxxx',
    ctx,
  );

  print(session.accessToken);
  print(session.refreshToken);

  print(session.$dPoPNonce);
  print(session.$publicKey);
  print(session.$privateKey);
}
1
likes
140
points
482
downloads

Publisher

verified publisheratprotodart.com

Weekly Downloads

Provides tools to handle OAuth for AT Protocol and Bluesky Social.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#atproto #bluesky #oauth

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (license)

Dependencies

convert, crypto, freezed_annotation, http, json_annotation, pointycastle

More

Packages that depend on atproto_oauth