Update README.md to provide a comprehensive overview of The Order monorepo, including repository structure, quickstart guide, development workflow, and contribution guidelines.
This commit is contained in:
31
packages/auth/src/oidc.ts
Normal file
31
packages/auth/src/oidc.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* OIDC/OAuth2 helpers
|
||||
*/
|
||||
|
||||
export interface OIDCConfig {
|
||||
issuer: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
redirectUri: string;
|
||||
}
|
||||
|
||||
export class OIDCProvider {
|
||||
constructor(private config: OIDCConfig) {}
|
||||
|
||||
async getAuthorizationUrl(state: string): Promise<string> {
|
||||
const params = new URLSearchParams({
|
||||
client_id: this.config.clientId,
|
||||
redirect_uri: this.config.redirectUri,
|
||||
response_type: 'code',
|
||||
scope: 'openid profile email',
|
||||
state,
|
||||
});
|
||||
return `${this.config.issuer}/authorize?${params.toString()}`;
|
||||
}
|
||||
|
||||
async exchangeCodeForToken(code: string): Promise<string> {
|
||||
// Implementation for token exchange
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user