question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support obtaining user auth tokens to pass to scaffolder process

See original GitHub issue

Feature Suggestion

Support a way to request user auth tokens for external services as part of the scaffolder frontend and pass them to the backend task process in order to call out to external APIs on behalf of the user.

Possible Implementation

The may involve refactoring createTemplateAction to allow custom actions to specify auth provider(s) and scopes it requires which tells the frontend to retrieve (or trigger the auth flow) the necessary user auth tokens and pass it to the backend task process possibly in the ctx object. One thing to consider with this is normalizing the providers and set of scopes defined among all actions in the scaffolder template to trigger an auth flow once per provider and obtain tokens with scopes to satisfy the requirements of all relevant actions.

If a scaffold template requires auth with multiple providers, its not really great UI to auto open multiple popups for each auth flow so an UI consideration may be to present the user with a form where they click each provider they need to auth with and it allows them to proceed once the form detects each provider auth has been satisfied.

In terms of defining custom auth providers, it looks like Backstage admins would do this by adding a new auth provider according to the docs in conjunction with installing custom actions that talks to the new external service. Is it possible to make this pluggable via a standalone Backstage app?

Context

The new v1beta2 template schema is awesome and now allows consumers to build template workflows that go beyond basic repo scaffolding like running custom actions to set up related infrastructure. In order to do this we wrote custom actions that call out to external APIs like Heroku to connect to and deploy our new repo.

However, in order to fully support this we need some way for the scaffolder frontend to trigger a user Oauth flow so they can sign in to and grant access to associated external services.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
benjdlambertcommented, Jan 27, 2022

Closed by #9168

1reaction
benjdlambertcommented, Sep 15, 2021

@sagacity I’d suggest that you hold off on this a little bit, as we were probably going to do it to prove that #7002 is valid for use. It’s a really interesting use case for that library, and probably going to be a lot of thought around how best to do it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scaffold Identity in ASP.NET Core projects - Microsoft Learn
When authentication tokens are provisioned and saved to the authentication cookie, they can be passed to components. Razor components can't use ...
Read more >
Get Started with Flutter Authentication - Auth0
Learn how to add user authentication to Flutter apps using OAuth 2.0 and OpenID Connect.
Read more >
Laravel Passport: A tutorial and example build - LogRocket Blog
Use Laravel Passport to set up an authentication system for your API with this step-by-step example build and tutorial.
Read more >
Laravel Passport - The PHP Framework For Web Artisans
Laravel Sanctum does not support OAuth2; however, it provides a much simpler API authentication development experience. Installation. To get started, install ...
Read more >
How to Build CRUD REST APIs with ASP.NET Core 3.1 and ...
Secure API endpoint · In code-behind, when we pass the authorization header to the API, authentication middleware parses and validates the token.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found