Laravel 8 - inertia-jetstream-fortify, redirect to a particular URL before login (i.e. On hit of main URL ex.-www.something.com) - laravel-8

I have a Single sign-in laravel application which is, say for example app-A. And my main application app-B. Now, whenever a user visits www.aap-B.com, I want the user to reach to the login page of app-A.
Since app-B is built using laravel fortify whenever I first hit the site url of app-B it takes me to the login page of app-b. How to edit this login route in laravel since it is coming from vendor/laravel/fortify folder. How to make app-B follow the first endpoint to direct to URL of app-A without going to the defult login route when we hit the URl of app-B for the first time.
I don't know where can I edit this login route in app-B. Any piece of advice would be of great help.

Related

Nuxt : Check route is redirected from other routes or directly load?

I'm face up with a problem when login.
If user is authenticated, I will let them redirect to home page.
And if they come from another protected route (homepage, other routes) and after logined, I want it redirect to exactly the route they came from.
My solution is:
In auth.js middleware, I will save to cookie the route they come from like this
app.$cookie.set("historyRoute", app.router.history.current.path)
In login.vue I will check if exist historyRoute to let them redirect then remove historyRoute from cookie.
But problem is that user will come from other protected routes and they do not take login action at that time, they make refreshing Login page many times and historyRoute will still exist in cookie.
So I want to know how to determine when visitors directly reload Login page to remove historyRoute in cookie.
Or if you have another solution, please suggest me know. Thanks.
Update flow:
Visitor access link /users/setting
-> check Auth
-> if Not Auth
-> redirect 302 to /Login
-> After login (I need to know they directly come from login page or from /user/setting then redirect to login page)
-> redirect back to users/setting

How to generate redirect url for Login link to IdentityServer url: https://localhost:5000/Account/Login?ReturnUrl=

I want to provide a simple 'Login' link on my website, but I'm unable to create a valid redirect url.
My link points to my IdentityServer4 /Account/Login page. How can I declare or generate a redirect url to my client website?
I've thought about simply pointing the login link to a page in my website that has to be [Authorize]'d ... which works, it does then forward on to the IdentityServer login page, but seems a dirty hack.
I've also tried to copy verbatim the url to the IdentityServer produced by this method, but not surprised, it fails with a "Correlation Failed" exception.
Here's the URL I am trying to use copied from an [Authorize] page redirect to IdentityServer, with the generated redirect string (separated for readability).
Localhost:44320 - IdentityServer
LocalHost:44390 - Website
https://localhost:44320/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3Dadminwebsite%26rediect_uri%3Dhttps%253A%252F%252Flocalhost%253A44390%252Fsignin-oidc%26response_type%3Dcode%2520id_token%26scope%3Dopenid%2520profile%2520address%2520roles%2520authorisationlevel%26response_mode%3Dform_post%26nonce%3D637402012214631946.OTEyMjNlMzMtMWY4NC20OTQyLWE2NmQt2WMzOWUyMWE4NjdkY2E5nWNmZDUtYzc1Ma00MdI3LTkgMjEtMjr3NyA3YzFkYHZl%26state%3DCfDJ8MY7uAeD4GSDitRtFHe5rPR44JW3TF346c95Sa7_TN0hZjLGDaJyTWAFSHKTgouPov4fDyJEJc6FsOkcg1gOSu4MxY7cqu4N11vPi4f0wu-JpnfWQbbTbtasrhyU-zSf45_aLAvURKmvnlvgogfp_dF_Om5vMYdfsGlvVzgJsiRsvOUGxipsv_hMvCpXmx5ecDHmQvn3xiJVKs2vkzIxI64vuKxPYpMvx44MxgkxwSxv1vnxvHxvXFVLvRvXqVXdfXEN6fvSBT08yr-farVUXVsjXVC3ReaF_sHVXC-fYTXVDJJXl5Q2eCVX7VXCGVKJ7XCcelc-ZFUXVCfqOXC0%26x-client-SKU%3DID_NETSTANDARD2_0%26x-client-ver%3D5.3.0.0
I simply want to declare a login link on my website that will allow the user to go to my IdentityServer, authorize then be redirected back to the same website page as before. I thought this would be a 5 minute job... I've searched all the IdentityServer documentation and google'd every permutation I can think of with no luck, any help will be much appreciated.

How to use FirebaseUI in redirect mode without a dedicated sign-in page?

I want to use FirebaseUI in redirect mode, as opposed to the current popup mode I'm using. But I don't want to have a separate dedicated login URL, instead I want the user to be able to log in from any URL (using a custom dialog as the UI container for FirebaseUI).
The problem I run into is that when starting the login process, I show the dialog and the user selects their auth provider, gets redirected to the auth website, but then they are redirected back to the original URL on my website.
Now the UI container dialog is not displayed and firebaseUI.start() doesn't get called because the webpage doesn't know that the user is in the process of logging in. The result is that nothing happens - the user is halfway through the login process.
Is there any way I can specify a URL for the first redirect? I'm not talking about the final signInSuccessUrl config parameter, but something similar for the first redirect back to my website?
That way I'd be able to send the original URL that started the login process along with a flag or something that tells the webpage that the user is in the middle of a login flow so that it can display the login process UI container and call firebaseUI.start() to perform the last redirect.
You can start FirebaseUI from any URL but the underlying signInWithRedirect always return to the same URL. Calling start on redirect will complete the sign in. If you have some condition, where you don't always display the sign in UI, you can use some flag pendingRedirect which you save in sessionStorage and check before rendering the UI to complete the sign-in on return. You would clear that after rendering.

Onedrive SDK Authentication Redirect Issue with Query Param

Currently, I'm trying to integrate the OneDrive SDK onto a website. However, I'm having issue with redirecting with authentication.
Normal route:
User goes to the website. It clicks on a button to single sign onto there OneDrive
User gets redirected to OneDrive Authorization page.
Once authentication, user gets redirected to where they left off. This redirect is specified in the OneDrive's SDK account. However, it seems that they don't allow query params in the redirect URL.
Is there a way around this?
The only thing I could figure out is using a URL that is an alias for the URL with the query params, but that just seems like a hack solution. It's hard to believe that there isn't a way for a user to redirect with query params to indicate at what stage they left off on the site.
Example of invalid redirect url as http://skydpk.com/index.php?a=ap&addon=file_sharing&page=skydrive
Any advice appreciated,
Thanks,
D
You can try registering your base URL as the redirect URL and just before initiating authorization action append the parameters to the redirect URL.
Redirect URL at one drive app dashboard : http://skydpk.com/index.php
Authorization URL
https://login.live.com/oauth20_authorize.srf?client_id=<your client id>&scope=<scope>&response_type=code&redirect_uri=http://skydpk.com/index.php?a=ap&addon=file_sharing&page=skydrive

socialengine v4 how to change the page members see after login

I have been trying to do this for days now and cant seem to find any help on how to do is. I want the user after login to be redirected to a different page instead of the members landing page.
Try checking the code in User/AuthController after this comment Run post login hook. There are several ways to do a custom redirect here.
specify a return_url parameter in the link to login page. You can also 64-bit encode the redirect url so that it is compact.
Keep a session variable, namely Zend_Session_Namespace('Redirect')->uri
Write a post login hook onUserLoginAfter and pass a redirect parameter in its response.
If all else fails, hard-code the next line of code which redirects to home :P