Installing the SpectroCloud Authentication Frontend Plugin#
This guide will help you install the SpectroCloud authentication frontend plugin in your Backstage instance.
Prerequisites#
Before installing the frontend plugin, ensure you have:
- A working Backstage instance (version 1.47.1 or later)
- Node.js 18+ and Yarn installed
- SpectroCloud backend module installed and configured (required)
Installation Steps#
1. Add Required Package#
Install the package using your package manager:
2. Verify Auto-Discovery#
The plugin is automatically discovered by Backstage. You can verify it's installed by checking:
3. No App.tsx Changes Needed!#
Unlike older Backstage plugins, this plugin is automatically loaded. There's no need to import or register it in App.tsx.
4. Configure Sign-In Page#
Option A: Global Sign-In Page Module (Easiest)#
If you're using the global sign-in page module:
Option B: Custom Sign-In Page#
If you have a custom sign-in page implementation, import the API reference:
import { spectroCloudAuthApiRef } from '@terasky/backstage-plugin-spectrocloud-auth';
const providers = [
{
id: 'spectrocloud-auth-provider',
title: 'SpectroCloud',
message: 'Sign in using SpectroCloud',
apiRef: spectroCloudAuthApiRef,
},
];
Quick Start Example#
Minimal Configuration#
app-config.yaml:
auth:
environment: development
providers:
spectrocloud:
development:
clientId: ${SPECTROCLOUD_CLIENT_ID}
clientSecret: ${SPECTROCLOUD_CLIENT_SECRET}
authorizationUrl: https://console.spectrocloud.com/v1/oidc/tenant/abc123/auth
callbackUrl: http://localhost:7007/api/auth/spectrocloud/handler/frame
signIn:
resolvers:
- resolver: emailMatchingUserEntityProfileEmail
signinPage:
providers:
spectrocloud:
enabled: true
Environment variables:
export SPECTROCLOUD_CLIENT_ID="your-client-id"
export SPECTROCLOUD_CLIENT_SECRET="your-client-secret"
Start Backstage:
Verification#
After installation, verify the plugin is working:
1. Check Dependencies#
Should show:
2. Check Build#
Should complete without errors.
3. Test Sign-In#
- Navigate to http://localhost:3000
- You should see "SpectroCloud" as a sign-in option
- Click it and complete authentication
- Verify you're logged in
4. Verify API Access#
Open browser console and run:
// After signing in
const authApi = await window.backstage.getApi('core.auth.spectrocloud');
const profile = await authApi.getProfile();
console.log(profile);
Integration with Other Components#
Sign-In Page#
The plugin automatically integrates with:
- Global Sign-In Page Module
- Custom sign-in pages using SignInPage component
- Backstage's authentication system
Backend Communication#
The plugin communicates with:
- SpectroCloud backend module at /api/auth/spectrocloud
- Backstage discovery API for endpoint resolution
Package Contents#
The package exports:
// Main plugin (default export)
export default spectroCloudAuthPlugin;
// API reference for use in other plugins
export { spectroCloudAuthApiRef };
// API Blueprint (advanced usage)
export { spectroCloudAuthApi };
Troubleshooting#
Plugin Not Found#
# Reinstall
yarn --cwd packages/app add @terasky/backstage-plugin-spectrocloud-auth
# Clear cache
yarn install --force
Build Errors#
# Check for type errors
yarn workspace app type-check
# Clean and rebuild
yarn workspace app clean
yarn workspace app build
Sign-In Option Not Showing#
- Verify backend module is installed and running
- Check
app-config.yamlhas SpectroCloud provider enabled - Review browser console for errors
- Check that
signinPage.providers.spectrocloud.enabledistrue
Import Errors#
# Ensure all peer dependencies are installed
yarn install
# Check for version conflicts
yarn why @backstage/frontend-plugin-api
Post-Installation#
After successful installation:
- Configure Backend - Ensure backend module has correct credentials
- Test Authentication - Complete a full sign-in flow
- Configure Resolvers - Set up user resolution in backend config
- Optional Features:
- Install Kubernetes auth module for cluster access
- Customize sign-in page appearance
- Configure multiple authentication providers
Next Steps#
- Configure Sign-In Page
- Install Kubernetes Module (optional)
- Review backend configuration