diff --git a/app/Config/Routes.php b/app/Config/Routes.php index fc4914a..67b7760 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -6,3 +6,7 @@ use CodeIgniter\Router\RouteCollection; * @var RouteCollection $routes */ $routes->get('/', 'Home::index'); + + +$routes->post('/digiusers/v1/identity/token', 'DigiFiAuth::starttoken'); +$routes->post('/digiusers/v1/identity/otoken', 'DigiFiAuth::starttoken'); diff --git a/app/Controllers/DigiFiAuth.php b/app/Controllers/DigiFiAuth.php new file mode 100644 index 0000000..37a60b6 --- /dev/null +++ b/app/Controllers/DigiFiAuth.php @@ -0,0 +1,24 @@ +request = \Config\Services::request(); + } + public function index(): string + { + return ''; + } + + public function starttoken() + { + $data = $this->request->getPost(); + $final_out = $data; + return json_encode( $final_out ); + + } +} diff --git a/composer.json b/composer.json index 082d7b6..3d5d42f 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ }, "require": { "php": "^7.4 || ^8.0", - "codeigniter4/framework": "^4.0" + "codeigniter4/framework": "^4.0", + "ext-json": "*" }, "require-dev": { "fakerphp/faker": "^1.9",