Routing to page with copy / paste URL across browsers

hi guys,

i have hit a small blocker, i think i know what it is, but would like to confirm my solution and thoughts before i do anything stupid :smiley:

i have an application working nicely, where i'm able to navigate to a search page and click on a record which opens the EDIT view

i pass a GUID as the primary key
it's working fine while i navigate to the page in app

if i grab that URL (including the GUID) and chuck it into another browser, i'm erroring out

i suspect this is because the GUID is actually being interpreted as a string on the copy / paste --> new browser

so the resolution to the problem would be to never parse a GUID to these EDIT pages, rather parse a GUID.ToString() which I then force to a GUID on the page load.

is that a reasonable summary of the issue and solution ?

actually, strike that, i i'm already doing that...

so is it more that there needs to be an expicit parameter declaration for Id if i re-use the URL in another browser?

or send the URL via email ?

(same thing)

so this is an example of a datagrid which navigates (successfully) to the page

ahh i htink i'm on the track now,

looks like it's a pain to deal with URL query strings on Radzen pages

soo....

perhaps the idea will be to use some code behind

  1. check if parameters.Id is not null, if it is, then see if there is a parameter in the query string
  2. use the value returned by #1

Check the exception stacktrace again - it ends with AccessTokenNotAvailableException . The user is not logged in when you paste the url in a new browser tab.

ahhh rightio, shouldn't Radzen automatically route to login first ?

thanks @korchev yep that got it, once i authenticated in alternate browser it worked like a charm.

but yeah to my earlier point, if i have a valid URL and am not authenticated, is there something i need to configure to route / re-route for authentication ?

If your page is configured to require authentication it should redirect to the login screen. Try debugging to see if there isn't any other problem.

ahh bingo, i had "everyone" in the page permissions,

i have pasted the URL into a logged out browser

it's now kicking me back to login where i can authenticate, and is routing to the home page

if i re-use the URL it then works nicely...

not sure why i'm not re-routing to the target page post authentication. any suggestion there?

i can see the login re-direct URL on the login page, it's not triggering for some reason

https://localhost:5001/Login?redirectUrl=edit-issues-actions-task%2F3e49f045-55b2-4255-9f0f-d0a8931e73d7

Debugging your application would tell more.

1 Like