parent
96c01b2fa0
commit
e234bc0d24
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,21 @@
|
||||
import {AuthenticationConfig, ORMUserRepository} from '@extollo/lib'
|
||||
import {AuthenticationConfig, CoreIDLoginProvider, OAuth2LoginProviderConfig, ORMUserRepository, env} from '@extollo/lib'
|
||||
|
||||
const authConfig: AuthenticationConfig = {
|
||||
storage: ORMUserRepository,
|
||||
providers: {
|
||||
coreid: {
|
||||
driver: CoreIDLoginProvider,
|
||||
config: {
|
||||
default: true,
|
||||
displayName: 'Starship CoreID',
|
||||
clientId: env('COREID_CLIENT_ID'),
|
||||
clientSecret: env('COREID_CLIENT_SECRET'),
|
||||
loginUrl: env('COREID_BASE', '') + '/auth/service/oauth2/authorize?client_id=%c&redirect_uri=%r',
|
||||
tokenUrl: env('COREID_BASE', '') + '/auth/service/oauth2/redeem',
|
||||
userUrl: env('COREID_BASE', '') + '/api/v1/auth/users/me',
|
||||
} as OAuth2LoginProviderConfig,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default authConfig
|
||||
|
@ -0,0 +1,24 @@
|
||||
import {OAuth2Client, OAuth2Scope, env, /*uuid4*/} from '@extollo/lib'
|
||||
|
||||
export default {
|
||||
secret: env('OAUTH2_SECRET'),
|
||||
scopes: {
|
||||
'user-info': {
|
||||
id: 'user-info',
|
||||
name: 'user-info',
|
||||
description: 'access basic information about your account',
|
||||
},
|
||||
} as {[key: string]: OAuth2Scope},
|
||||
clients: {
|
||||
// 'test-1': {
|
||||
// id: 'test-1',
|
||||
// display: 'Test 1',
|
||||
// secret: env('TEST_CLIENT_SECRET', uuid4()),
|
||||
// allowedFlows: ['code'],
|
||||
// allowedScopeIds: ['user-info'],
|
||||
// allowedRedirectUris: [
|
||||
// 'http://localhost:1234/callback',
|
||||
// ],
|
||||
// },
|
||||
} as {[key: string]: OAuth2Client},
|
||||
}
|
@ -1,14 +1,13 @@
|
||||
import {Route} from '@extollo/lib'
|
||||
import {Home} from "../controllers/main/Home.controller";
|
||||
import {AuthRequiredMiddleware} from "@extollo/lib/lib/auth/middleware/AuthRequiredMiddleware";
|
||||
import {Route, SessionAuthMiddleware, AuthRequiredMiddleware} from '@extollo/lib'
|
||||
import {Home} from '../controllers/main/Home.controller'
|
||||
|
||||
Route.group('/', () => {
|
||||
Route.get('/')
|
||||
.calls<Home>(Home, home => home.welcome)
|
||||
})
|
||||
|
||||
Route.group('', () => {
|
||||
Route.get('/dash')
|
||||
.pre(AuthRequiredMiddleware)
|
||||
.calls<Home>(Home, home => home.welcome)
|
||||
})
|
||||
|
||||
// BasicLoginController.routes()
|
||||
}).pre(SessionAuthMiddleware)
|
||||
|
Loading…
Reference in new issue