angular-yii2 icon indicating copy to clipboard operation
angular-yii2 copied to clipboard

How to pass username and password in url

Open mushahidh opened this issue 10 years ago • 10 comments
trafficstars

Hi, Whenever i tried to access api i get this response {"name":"Not Found","message":"Page not found.","code":0,"status":404,"type":"yii\web\NotFoundHttpException"}

I want to know how to fully access an API by passing username and password in url?

Thanks in advance

mushahidh avatar Aug 18 '15 11:08 mushahidh

Hi, See https://github.com/githubjeka/angular-yii2/issues/5#issuecomment-101927223

githubjeka avatar Aug 18 '15 11:08 githubjeka

Thanks for your prompt response. I got it working. Just one more thing. How to configure angular client ? See in the image. all the paths are not configured correctly? is there anything i am missing? Thanks in advance angular

mushahidh avatar Aug 18 '15 15:08 mushahidh

Set meta base to subfolder https://github.com/AngularYii2/angularyii2.github.io/blob/master/index.html#L7

githubjeka avatar Aug 18 '15 15:08 githubjeka

App is getting data from your server . I have changed the URL in app.js from https://yii2-rest-githubjeka.c9.io/rest/web to http://localhost:8080/angular-yii2/rest/rest/web/ but still data is coming from your server instead of mine local server.

mushahidh avatar Aug 18 '15 16:08 mushahidh

This can not be, maybe you forgot to save the file :)

githubjeka avatar Aug 18 '15 16:08 githubjeka

Sorry to bother you again. it worked when i deleted my cache. But now when i click on Post published tab it gives me an error of 401 unauthorized and redirect me to this url http://localhost:8080/#!/login which shows me wamp home screen. Is there a way to solve this issue? http://localhost:8080/angular-yii2/client-angular/login also giving me 404.

mushahidh avatar Aug 18 '15 16:08 mushahidh

https://github.com/AngularYii2/angularyii2.github.io/wiki/Getting-404-error-on-reloaded-page.

githubjeka avatar Aug 18 '15 17:08 githubjeka

You should configure virtual host for rest and client app. All your troubles associated with subfolders. To easy using set http://rest.local to rest/rest/web and http://client.local to client-angular a folder.

githubjeka avatar Aug 18 '15 17:08 githubjeka

@githubjeka I am really thankful to you the way you helped me :). Actually it's my first experience with yii2+rest+angular. So i found your work very much helpful. Don't mind but i will keep disturbing you if i am unable to solve some problem.

mushahidh avatar Aug 20 '15 08:08 mushahidh

Ok, and better create new issue for your future problems

githubjeka avatar Aug 20 '15 10:08 githubjeka