KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to implement Google OAuth 2.0 to the Dashboard #3114

Open Eugene opened this topic on on Aug 5, 2023 - 3 comments

Eugene commented on Aug 5, 2023

Hi,

for some of my Dashboard pages, I need that user was authorized via Google OAuth 2.0. Ho to implement it in the best way? I planned to use CustomDashboard for it but was a bit confused about where to put the code that arranges the request to Google OAuth service. An example of usage you can find here

The second point is the RedirectUri. As I understand Koolreport dashboard doesn't have any routing so how can I redirect user to the specific page of my dashboard?

Eugene commented on Aug 12, 2023

up

Sebastian Morales commented on Aug 14, 2023

You can try handling login authentication in your Dashboard's App.php's function login(). If the code is large and complex you can create a separate class file and use the class in function login().

As for Dashboard's server redirect you can use these commands:

$request->route("App/Unauthorized");
$request->route("App/".$page->name());
$request->route($request->params("currentRoute"))->action("refreshPage");

If you have another case which can not be applied with these let us know.

Eugene commented on Aug 14, 2023

Thank you,

I think the login function is not the place that I need. I use the koolreport internal authorization mechanism and I Implement the local authorisation logic with it like this – user can have access to page 1 but cannot to page 2 but I need also to authorize a user with Google OAuth service only for access page 1. So I need to to make the request to Google OAuth service only when user go to this page when the user try to open it and I don't need it for other pages.

About redirects. Sorry maybe I was not to clear. I need to implement the following - I want to open exactly page 1 in dashboard using URI like this mydashboard.com/page1 Maybe it is possible to do with the commands your provided but could you be a bit more detailed.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Dashboard